diff --git a/bin/v_add_cron_job b/bin/v_add_cron_job index d442aee8b..531af4f5c 100755 --- a/bin/v_add_cron_job +++ b/bin/v_add_cron_job @@ -1,5 +1,10 @@ #!/bin/bash -# info: adding cron job +# info: add cron job +# arguments: user min hour day month wday command [job] +# +# 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'. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_change_cron_job b/bin/v_change_cron_job index f56c0d68d..d223966c8 100755 --- a/bin/v_change_cron_job +++ b/bin/v_change_cron_job @@ -1,5 +1,10 @@ #!/bin/bash -# info: changing cron job +# info: change cron job +# arguments: user job min hour day month wday command +# +# The function is used for changing existing job. It fully replace job +# parameters with new one but with same id. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_delete_cron_job b/bin/v_delete_cron_job index b74f365a0..4e8406be2 100755 --- a/bin/v_delete_cron_job +++ b/bin/v_delete_cron_job @@ -1,5 +1,9 @@ #!/bin/bash -# info: deleting sys cron +# info: delete cron job +# arguments: user job +# +# The function deletes cron job. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_list_cron_jobs b/bin/v_list_cron_jobs index 525fc1979..1deac5c9f 100755 --- a/bin/v_list_cron_jobs +++ b/bin/v_list_cron_jobs @@ -1,5 +1,9 @@ #!/bin/bash -# info: listing user cron +# info: list user cron jobs +# arguments: user [format] +# +# The function for obtaining the list of all users cron jobs. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_rebuild_cron_jobs b/bin/v_rebuild_cron_jobs index c375e245b..c7782aa87 100755 --- a/bin/v_rebuild_cron_jobs +++ b/bin/v_rebuild_cron_jobs @@ -1,5 +1,9 @@ #!/bin/bash -# info: rebuild cron job +# info: rebuild cron jobs +# arguments: user +# +# The function rebuilds system cron config file for specified user. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_restart_cron b/bin/v_restart_cron index 5bd6e0e67..642e20288 100755 --- a/bin/v_restart_cron +++ b/bin/v_restart_cron @@ -1,23 +1,35 @@ #!/bin/bash -# Internal vesta function -# cron system restart +# info: restart cron service +# arguments: none +# +# The function tells crond service to reread its configuration files. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# # Importing variables source $VESTA/conf/vars.conf source $V_CONF/vesta.conf -crond() { - /etc/init.d/crond 'reload' >/dev/null 2>&1 - if [ $? -ne 0 ]; then - #$V_FUNC/report_issue 'sys' 'cron' - echo "$E_RESTART_FAILED $V_EVENT" - fi -} + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# # Parsing config / or just source config if [ "$CRON_SYSTEM" = 'crond' ]; then - crond + /etc/init.d/crond 'reload' >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "$E_PARSING $V_EVENT" + exit $E_PARSING + fi fi -# Logging + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + exit diff --git a/bin/v_suspend_cron_job b/bin/v_suspend_cron_job index 05caede86..702ca2b29 100755 --- a/bin/v_suspend_cron_job +++ b/bin/v_suspend_cron_job @@ -1,5 +1,9 @@ #!/bin/bash -# info: Suspending sys cron +# info: suspend cron job +# arguments: user job +# +# The function suspends a certain job of the cron scheduler. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_suspend_cron_jobs b/bin/v_suspend_cron_jobs index 294c80e3d..879068aed 100755 --- a/bin/v_suspend_cron_jobs +++ b/bin/v_suspend_cron_jobs @@ -1,5 +1,9 @@ #!/bin/bash # info: Suspending sys cron jobs +# arguments: user +# +# The function suspends all user cron jobs. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_unsuspend_cron_job b/bin/v_unsuspend_cron_job index bee60fd5b..01818733a 100755 --- a/bin/v_unsuspend_cron_job +++ b/bin/v_unsuspend_cron_job @@ -1,5 +1,9 @@ #!/bin/bash -# info: Unuspending sys cron +# info: unuspend cron job +# arguments: user job +# +# The function unsuspen certain cron job. + #----------------------------------------------------------# # Variable&Function # diff --git a/bin/v_unsuspend_cron_jobs b/bin/v_unsuspend_cron_jobs index 170e4e287..dcaa6a65b 100755 --- a/bin/v_unsuspend_cron_jobs +++ b/bin/v_unsuspend_cron_jobs @@ -1,5 +1,9 @@ #!/bin/bash -# info: Unuspending sys cron +# info: unuspend sys cron +# arguments: user +# +# The function unsuspends all suspended cron jobs. + #----------------------------------------------------------# # Variable&Function #