cron rebuild function

This commit is contained in:
Serghey Rodin 2011-10-28 11:17:33 +03:00
commit 8a5d155fb4

52
bin/v_rebuild_sys_cron Executable file
View file

@ -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