From 2cbdd16d789ab35039206b758c581f93b376b301 Mon Sep 17 00:00:00 2001 From: MaxXor Date: Wed, 5 Jan 2022 10:51:50 +0100 Subject: [PATCH] Add doc for automated cold-standby backups --- docs/b_n_r-coldstandby.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/b_n_r-coldstandby.md b/docs/b_n_r-coldstandby.md index 5227ccb34..67a52a96a 100644 --- a/docs/b_n_r-coldstandby.md +++ b/docs/b_n_r-coldstandby.md @@ -69,3 +69,30 @@ bash /opt/mailcow-dockerized/create_cold_standby.sh It's the same command. +## Automated backups with cron + +First make sure that the `cron` service is enabled and running: + +``` +systemctl enable cron.service && systemctl start cron.service +``` + +To automate the backups to the cold-standby server you can use a cron job. To edit the cron jobs for the root user run: + +``` +crontab -e +``` + +Add the following lines to synchronize the cold standby server daily at 03:00. In this example errors of the last execution are logged into a file. + +``` +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +0 3 * * * bash /opt/mailcow-dockerized/create_cold_standby.sh 2> /var/log/mailcow-coldstandby-sync.log +``` + +If saved correctly, the cron job should be shown by typing: + +``` +crontab -l +```