From 8a5d155fb4789dacb4ada1d86a0b449eb521589b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 28 Oct 2011 11:17:33 +0300 Subject: [PATCH] cron rebuild function --- bin/v_rebuild_sys_cron | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 bin/v_rebuild_sys_cron diff --git a/bin/v_rebuild_sys_cron b/bin/v_rebuild_sys_cron new file mode 100755 index 00000000..578415ab --- /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