mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Added cron tab triggers. Issue #50
This commit is contained in:
parent
18c9bf45e6
commit
ba50b1c4c0
4 changed files with 10 additions and 4 deletions
|
@ -46,6 +46,7 @@ is_job_suspended
|
|||
|
||||
# Suspending job
|
||||
update_cron_job_value '$SUSPENDED' 'yes'
|
||||
increase_user_value "$user" '$SUSPENDED_CRON'
|
||||
|
||||
# Sync system cron with user
|
||||
sync_cron_jobs
|
||||
|
@ -56,7 +57,9 @@ sync_cron_jobs
|
|||
#----------------------------------------------------------#
|
||||
|
||||
# Adding task to the vesta pipe
|
||||
restart_schedule 'cron'
|
||||
if [ "$3" != 'no_restart' ]; then
|
||||
restart_schedule 'cron'
|
||||
fi
|
||||
|
||||
# Logging
|
||||
log_event 'system' "$V_EVENT"
|
||||
|
|
|
@ -45,7 +45,7 @@ jobs=$(cron_clear_search)
|
|||
|
||||
# Suspendning
|
||||
for job in $jobs; do
|
||||
update_cron_job_value '$SUSPENDED' 'yes'
|
||||
$V_BIN/v_suspend_cron_job $user $job 'no_restart'
|
||||
done
|
||||
|
||||
# Sync system cron with user
|
||||
|
|
|
@ -46,6 +46,7 @@ is_job_unsuspended
|
|||
|
||||
# Unsuspending job
|
||||
update_cron_job_value '$SUSPENDED' 'no'
|
||||
decrease_user_value "$user" '$SUSPENDED_CRON'
|
||||
|
||||
# Sync system cron with user
|
||||
sync_cron_jobs
|
||||
|
@ -56,7 +57,9 @@ sync_cron_jobs
|
|||
#----------------------------------------------------------#
|
||||
|
||||
# Adding task to the vesta pipe
|
||||
restart_schedule 'cron'
|
||||
if [ "$3" != 'no_restart' ]; then
|
||||
restart_schedule 'cron'
|
||||
fi
|
||||
|
||||
# Logging
|
||||
log_event 'system' "$V_EVENT"
|
||||
|
|
|
@ -45,7 +45,7 @@ jobs=$(cron_clear_search)
|
|||
|
||||
# Unsuspendning jobs
|
||||
for job in $jobs; do
|
||||
update_cron_job_value '$SUSPENDED' 'no'
|
||||
$V_BIN/v_unsuspend_cron_job $user $job 'no_restart'
|
||||
done
|
||||
|
||||
# Sync system cron with user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue