MailSuite Pro documentation

Backup/restore procedure

The script

Script for backup/restore is found at the following path:

/opt/afterlogic/scripts/afterlogic-backup.sh

You can also download the script here.

Usage tips

When you invoke the script without parameters, it tells how to use it:

[root@centos-x64 scripts]# ./afterlogic-backup.sh
Usage: ./afterlogic-backup.sh {backup|restore YYYY-MM-DD}

Backup

With backup parameter used, two files are created:

/opt/afterlogic/afterlogic-backups/afterlogic-backup-YYYY-MM-DD.tar.bz2
/opt/afterlogic/afterlogic-backups/afterlogic-backup-YYYY-MM-DD.sql

Example:

afterlogic-backup-2010-07-20.tar.bz2 
afterlogic-mysql-backup-2010-07-20.sql

*.tar.bz2 archive contains directories "${BASEDIR}/data" "${BASEDIR}/etc" "${BASEDIR}/html/data"

*.sql file contains dump (scheme+data) of "exim" database

${BASEDIR}=/opt/afterolgic

Restore

When:

afterlogic-backup.sh restore YYYY-MM-DD

is execured, the archive /opt/afterlogic/afterlogic-backups/afterlogic-backup-YYYY-MM-DD.tar.bz2 is extracted, and MySQL data are restored from /opt/afterlogic/afterlogic-backups/afterlogic-backup-YYYY-MM-DD.sql file.

Automated backup

For automated backup performed every 24 hours add the following line to root crontab (file /var/log/spool/cron/root):

* */24 * * * /bin/bash /opt/afterlogic/scripts/afterlogic-backup.sh backup

or

* 0 * * * /bin/bash /opt/afterlogic/scripts/afterlogic-backup.sh backup

or

* * */1 * * /bin/bash /opt/afterlogic/scripts/afterlogic-backup.sh backup