Skip to content

Commit c39bef7

Browse files
committed
Added daily midnight cronjob
1 parent 4e86b2e commit c39bef7

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

bin/v-update-sys-queue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ case $queue in
5252
webstats) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
5353
backup) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
5454
disk) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
55+
daily) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
5556
traffic) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1;;
5657
dns-cluster) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;
5758
letsencrypt) bash $HESTIA/data/queue/$queue.pipe > /dev/null 2>&1 ;;

install/hst-install-debian.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
991991
$HESTIA/data/sessions
992992
touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
993993
$HESTIA/data/queue/webstats.pipe $HESTIA/data/queue/restart.pipe \
994-
$HESTIA/data/queue/traffic.pipe $HESTIA/log/system.log \
994+
$HESTIA/data/queue/traffic.pipe $HESTIA/data/queue/daily.pipe $HESTIA/log/system.log \
995995
$HESTIA/log/nginx-error.log $HESTIA/log/auth.log
996996
chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
997997
chmod -R 750 $HESTIA/data/queue
@@ -1787,6 +1787,8 @@ command="sudo $HESTIA/bin/v-update-sys-queue restart"
17871787
$HESTIA/bin/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
17881788
systemctl restart cron
17891789

1790+
command="sudo $HESTIA/bin/v-update-sys-queue daily"
1791+
$HESTIA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
17901792
command="sudo $HESTIA/bin/v-update-sys-queue disk"
17911793
$HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
17921794
command="sudo $HESTIA/bin/v-update-sys-queue traffic"

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
969969
$HESTIA/data/sessions
970970
touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
971971
$HESTIA/data/queue/webstats.pipe $HESTIA/data/queue/restart.pipe \
972-
$HESTIA/data/queue/traffic.pipe $HESTIA/log/system.log \
972+
$HESTIA/data/queue/traffic.pipe $HESTIA/data/queue/daily.pipe $HESTIA/log/system.log \
973973
$HESTIA/log/nginx-error.log $HESTIA/log/auth.log
974974
chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
975975
chmod -R 750 $HESTIA/data/queue
@@ -1734,6 +1734,8 @@ command="sudo $HESTIA/bin/v-update-sys-queue restart"
17341734
$HESTIA/bin/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
17351735
systemctl restart cron
17361736

1737+
command="sudo $HESTIA/bin/v-update-sys-queue daily"
1738+
$HESTIA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
17371739
command="sudo $HESTIA/bin/v-update-sys-queue disk"
17381740
$HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
17391741
command="sudo $HESTIA/bin/v-update-sys-queue traffic"

install/upgrade/versions/latest.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ if [ -d /usr/share/roundcube ]; then
3939
sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
4040
fi
4141

42+
43+
# Add daily midnight cron
44+
if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue daily')" ]; then
45+
command="sudo $BIN/v-update-sys-queue daily"
46+
$BIN/v-add-cron-job 'admin' '01' '00' '*' '*' '*' "$command"
47+
fi
48+
[ ! -f "touch $HESTIA/data/queue/daily.pipe" ] && touch $HESTIA/data/queue/daily.pipe
49+
4250
# Remove existing network-up hooks so they get regenerated when updating the firewall
4351
# - network hook will also restore ipset config during start-up
4452
if [ -f "/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks" ]; then

0 commit comments

Comments
 (0)