forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-add-cron-restart-job
executable file
·43 lines (30 loc) · 1.23 KB
/
v-add-cron-restart-job
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# info: add cron reports
# opions: NONE
#
# The script for enabling restart cron tasks
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Add cron job
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue restart"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
$BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd"
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit