Robert Zollner 5 лет назад
Родитель
Сommit
c39bef7055

+ 1 - 0
bin/v-update-sys-queue

@@ -52,6 +52,7 @@ case $queue in
     webstats)       bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
     backup)         bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
     disk)           bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
+    daily)          bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
     traffic)        bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
     dns-cluster)    bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
     letsencrypt)    bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;

+ 3 - 1
install/hst-install-debian.sh

@@ -991,7 +991,7 @@ mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
     $HESTIA/data/sessions
 touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
     $HESTIA/data/queue/webstats.pipe $HESTIA/data/queue/restart.pipe \
-    $HESTIA/data/queue/traffic.pipe $HESTIA/log/system.log \
+    $HESTIA/data/queue/traffic.pipe $HESTIA/data/queue/daily.pipe $HESTIA/log/system.log \
     $HESTIA/log/nginx-error.log $HESTIA/log/auth.log
 chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
 chmod -R 750 $HESTIA/data/queue
@@ -1787,6 +1787,8 @@ command="sudo $HESTIA/bin/v-update-sys-queue restart"
 $HESTIA/bin/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
 systemctl restart cron
 
+command="sudo $HESTIA/bin/v-update-sys-queue daily"
+$HESTIA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-queue disk"
 $HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-queue traffic"

+ 3 - 1
install/hst-install-ubuntu.sh

@@ -969,7 +969,7 @@ mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
     $HESTIA/data/sessions
 touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
     $HESTIA/data/queue/webstats.pipe $HESTIA/data/queue/restart.pipe \
-    $HESTIA/data/queue/traffic.pipe $HESTIA/log/system.log \
+    $HESTIA/data/queue/traffic.pipe $HESTIA/data/queue/daily.pipe $HESTIA/log/system.log \
     $HESTIA/log/nginx-error.log $HESTIA/log/auth.log
 chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
 chmod -R 750 $HESTIA/data/queue
@@ -1734,6 +1734,8 @@ command="sudo $HESTIA/bin/v-update-sys-queue restart"
 $HESTIA/bin/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
 systemctl restart cron
 
+command="sudo $HESTIA/bin/v-update-sys-queue daily"
+$HESTIA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-queue disk"
 $HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-queue traffic"

+ 8 - 0
install/upgrade/versions/latest.sh

@@ -39,6 +39,14 @@ if [ -d /usr/share/roundcube ]; then
     sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
 fi
 
+
+# Add daily midnight cron
+if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue daily')" ]; then
+    command="sudo $BIN/v-update-sys-queue daily"
+    $BIN/v-add-cron-job 'admin' '01' '00' '*' '*' '*' "$command"
+fi
+[ ! -f "touch $HESTIA/data/queue/daily.pipe" ] && touch $HESTIA/data/queue/daily.pipe
+
 # Remove existing network-up hooks so they get regenerated when updating the firewall
 # - network hook will also restore ipset config during start-up
 if [ -f "/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks" ]; then