|
|
@@ -0,0 +1,43 @@
|
|
|
+#!/bin/bash
|
|
|
+# info: add cron reports
|
|
|
+# opions: NONE
|
|
|
+#
|
|
|
+# The script for enabling restart cron tasks
|
|
|
+
|
|
|
+
|
|
|
+#----------------------------------------------------------#
|
|
|
+# Variable&Function #
|
|
|
+#----------------------------------------------------------#
|
|
|
+
|
|
|
+# Includes
|
|
|
+source $VESTA/conf/vesta.conf
|
|
|
+source $VESTA/func/main.sh
|
|
|
+
|
|
|
+
|
|
|
+#----------------------------------------------------------#
|
|
|
+# 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
|