mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
implemented scheduled restart
This commit is contained in:
parent
ca81632e82
commit
10f7097c48
46 changed files with 172 additions and 63 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# info: add cron job
|
||||
# options: USER MIN HOUR DAY MONTH WDAY COMMAND [JOB]
|
||||
# options: USER MIN HOUR DAY MONTH WDAY COMMAND [JOB] [RESTART]
|
||||
#
|
||||
# The function adds a job to cron daemon. When executing commands, any output
|
||||
# is mailed to user's email if parameter REPORTS is set to 'yes'.
|
||||
|
@ -19,6 +19,7 @@ month=$5
|
|||
wday=$6
|
||||
command=$(echo $7 | sed -e "s/'/%quote%/g")
|
||||
job=$8
|
||||
restart=$9
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
@ -32,7 +33,7 @@ A7="$command"
|
|||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '7' "$#" 'USER MIN HOUR DAY MONTH WDAY COMMAND [JOB]'
|
||||
check_args '7' "$#" 'USER MIN HOUR DAY MONTH WDAY COMMAND [JOB] [RESTART]'
|
||||
validate_format 'user' 'min' 'hour' 'day' 'month' 'wday' 'command'
|
||||
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
|
@ -72,7 +73,7 @@ sync_cron_jobs
|
|||
increase_user_value $user '$U_CRON_JOBS'
|
||||
|
||||
# Restart crond
|
||||
$BIN/v-restart-cron "$EVENT"
|
||||
$BIN/v-restart-cron
|
||||
|
||||
# Logging
|
||||
log_history "added cron job $job"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue