mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 22:04:00 -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
|
# Suspending job
|
||||||
update_cron_job_value '$SUSPENDED' 'yes'
|
update_cron_job_value '$SUSPENDED' 'yes'
|
||||||
|
increase_user_value "$user" '$SUSPENDED_CRON'
|
||||||
|
|
||||||
# Sync system cron with user
|
# Sync system cron with user
|
||||||
sync_cron_jobs
|
sync_cron_jobs
|
||||||
|
@ -56,7 +57,9 @@ sync_cron_jobs
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'cron'
|
if [ "$3" != 'no_restart' ]; then
|
||||||
|
restart_schedule 'cron'
|
||||||
|
fi
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log_event 'system' "$V_EVENT"
|
log_event 'system' "$V_EVENT"
|
||||||
|
|
|
@ -45,7 +45,7 @@ jobs=$(cron_clear_search)
|
||||||
|
|
||||||
# Suspendning
|
# Suspendning
|
||||||
for job in $jobs; do
|
for job in $jobs; do
|
||||||
update_cron_job_value '$SUSPENDED' 'yes'
|
$V_BIN/v_suspend_cron_job $user $job 'no_restart'
|
||||||
done
|
done
|
||||||
|
|
||||||
# Sync system cron with user
|
# Sync system cron with user
|
||||||
|
|
|
@ -46,6 +46,7 @@ is_job_unsuspended
|
||||||
|
|
||||||
# Unsuspending job
|
# Unsuspending job
|
||||||
update_cron_job_value '$SUSPENDED' 'no'
|
update_cron_job_value '$SUSPENDED' 'no'
|
||||||
|
decrease_user_value "$user" '$SUSPENDED_CRON'
|
||||||
|
|
||||||
# Sync system cron with user
|
# Sync system cron with user
|
||||||
sync_cron_jobs
|
sync_cron_jobs
|
||||||
|
@ -56,7 +57,9 @@ sync_cron_jobs
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'cron'
|
if [ "$3" != 'no_restart' ]; then
|
||||||
|
restart_schedule 'cron'
|
||||||
|
fi
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log_event 'system' "$V_EVENT"
|
log_event 'system' "$V_EVENT"
|
||||||
|
|
|
@ -45,7 +45,7 @@ jobs=$(cron_clear_search)
|
||||||
|
|
||||||
# Unsuspendning jobs
|
# Unsuspendning jobs
|
||||||
for job in $jobs; do
|
for job in $jobs; do
|
||||||
update_cron_job_value '$SUSPENDED' 'no'
|
$V_BIN/v_unsuspend_cron_job $user $job 'no_restart'
|
||||||
done
|
done
|
||||||
|
|
||||||
# Sync system cron with user
|
# Sync system cron with user
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue