mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
定时任务增加运行任务前和运行任务后参数
This commit is contained in:
@@ -436,11 +436,23 @@ handle_task_before() {
|
||||
[[ $is_macos -eq 0 ]] && check_server
|
||||
|
||||
. $file_task_before "$@"
|
||||
|
||||
if [[ $task_before ]]; then
|
||||
echo -e "执行前置命令\n"
|
||||
eval "$task_before"
|
||||
echo -e "\n执行前置命令结束\n"
|
||||
fi
|
||||
}
|
||||
|
||||
handle_task_after() {
|
||||
. $file_task_after "$@"
|
||||
|
||||
if [[ $task_after ]]; then
|
||||
echo -e "\n执行后置命令\n"
|
||||
eval "$task_after"
|
||||
echo -e "\n执行后置命令结束"
|
||||
fi
|
||||
|
||||
local etime=$(date "+$time_format")
|
||||
local end_time=$(format_time "$time_format" "$etime")
|
||||
local end_timestamp=$(format_timestamp "$time_format" "$etime")
|
||||
|
||||
Reference in New Issue
Block a user