diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d204e08..96325f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Control panel: System: +* Nightly backups and system status checks are now moved to 3am in the system's timezone. * fail2ban's recidive jail is now active, which guards against persistent brute force login attacks over long periods of time. * Setup (first run only) now asks for your timezone to set the system time. * The Exchange/ActiveSync server is now taken offline during nightly backups (along with SMTP and IMAP). @@ -31,6 +32,7 @@ System: * Fix pip command that might have not installed all necessary Python packages. * The control panel and backup would not work on Google Compute Engine because GCE installs a conflicting boto package. * Added a new command `management/backup.py --restore` to restore files from a backup to a target directory (command line arguments are passed to `duplicity restore`). +* Update Roundcube to version 1.1.3. v0.14 (November 4, 2015) ------------------------ diff --git a/management/daily_tasks.sh b/management/daily_tasks.sh new file mode 100755 index 00000000..6237e6c2 --- /dev/null +++ b/management/daily_tasks.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This script is run daily (at 3am each night). + +# Take a backup. +management/backup.py + +# Run status checks and email the administrator if anything changed. +management/status_checks.py --show-changes --smtp diff --git a/setup/management.sh b/setup/management.sh index b69001a7..3ca1687c 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -31,25 +31,18 @@ rm -f /etc/init.d/mailinabox ln -s $(pwd)/conf/management-initscript /etc/init.d/mailinabox hide_output update-rc.d mailinabox defaults -# Perform a daily backup. -cat > /etc/cron.daily/mailinabox-backup << EOF; -#!/bin/bash -# Mail-in-a-Box --- Do not edit / will be overwritten on update. -# Perform a backup. -$(pwd)/management/backup.py -EOF -chmod +x /etc/cron.daily/mailinabox-backup +# Remove old files we no longer use. +rm -f /etc/cron.daily/mailinabox-backup +rm -f /etc/cron.daily/mailinabox-statuschecks -# Perform daily status checks. Compare each day to the previous -# for changes and mail the changes to the administrator. -cat > /etc/cron.daily/mailinabox-statuschecks << EOF; -#!/bin/bash -# Mail-in-a-Box --- Do not edit / will be overwritten on update. -# Run status checks. -$(pwd)/management/status_checks.py --show-changes --smtp -EOF -chmod +x /etc/cron.daily/mailinabox-statuschecks +# Perform nightly tasks at 3am in system time: take a backup, run +# status checks and email the administrator any changes. +cat > /etc/cron.d/mailinabox-nightly << EOF; +# Mail-in-a-Box --- Do not edit / will be overwritten on update. +# Run nightly tasks: backup, status checks. +0 3 * * * root (cd `pwd` && management/daily_tasks.sh) +EOF # Start it. restart_service mailinabox