diff --git a/bin/v_rebuild_sys_cron b/bin/v_rebuild_sys_cron new file mode 100755 index 000000000..578415ab4 --- /dev/null +++ b/bin/v_rebuild_sys_cron @@ -0,0 +1,52 @@ +#!/bin/bash +# info: rebuild cron job + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +user="$1" + +# Importing variables +source $VESTA/conf/vars.conf +source $V_FUNC/shared_func.sh +source $V_FUNC/cron_func.sh + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +# Checking arg number +check_args '1' "$#" 'user' + +# Checking argument format +format_validation 'user' + +# Checking cron system +is_system_enabled 'cron' + +# Checking user +is_user_valid + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Rebuild cron jobs +sync_cron_jobs + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Adding task to the vesta pipe +restart_schedule 'cron' + +# Logging +log_event 'system' "$V_EVENT" + +exit $OK