Skip to content

Commit 8a5d155

Browse files
committed
cron rebuild function
1 parent 3bcddb3 commit 8a5d155

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

bin/v_rebuild_sys_cron

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
# info: rebuild cron job
3+
4+
#----------------------------------------------------------#
5+
# Variable&Function #
6+
#----------------------------------------------------------#
7+
8+
# Argument defenition
9+
user="$1"
10+
11+
# Importing variables
12+
source $VESTA/conf/vars.conf
13+
source $V_FUNC/shared_func.sh
14+
source $V_FUNC/cron_func.sh
15+
16+
17+
#----------------------------------------------------------#
18+
# Verifications #
19+
#----------------------------------------------------------#
20+
21+
# Checking arg number
22+
check_args '1' "$#" 'user'
23+
24+
# Checking argument format
25+
format_validation 'user'
26+
27+
# Checking cron system
28+
is_system_enabled 'cron'
29+
30+
# Checking user
31+
is_user_valid
32+
33+
34+
#----------------------------------------------------------#
35+
# Action #
36+
#----------------------------------------------------------#
37+
38+
# Rebuild cron jobs
39+
sync_cron_jobs
40+
41+
42+
#----------------------------------------------------------#
43+
# Vesta #
44+
#----------------------------------------------------------#
45+
46+
# Adding task to the vesta pipe
47+
restart_schedule 'cron'
48+
49+
# Logging
50+
log_event 'system' "$V_EVENT"
51+
52+
exit $OK

0 commit comments

Comments
 (0)