diff --git a/Readme.md b/Readme.md index b34c029e23cf6b95e2dc3d7c7123aa0a4ab66523..2476d44ca1dee3145b165e564828449bb4f529b7 100644 --- a/Readme.md +++ b/Readme.md @@ -19,3 +19,31 @@ Then add a cronjob like ``` 0 1 * * 1,3,5,7 /opt/duplicity-ftp-backup/backup.sh > /var/log/bckp.log 2>&1 ``` + +## Advanced options + +### Multiple backup servers + +By default the backup system will look for it's configuration in the `.env` file next to the `backup.sh` path, i.e `/opt/duplicity-ftp-backup/.env`. + +All the scripts accepts a `.env` path as their first argument, so if you want several cronjobs with different backup server, create as many `.env` file as you need than set your cronjobs : + +``` +# Main backup +0 1 * * * /opt/duplicity-ftp-backup/backup.sh > /var/log/bckp.log 2>&1 +# Secondary backup +0 3 * * 6 /opt/duplicity-ftp-backup/backup.sh /opt/duplicity-ftp-backup/.secondary-server.env > /var/log/bckp-secondary.log 2>&1 +``` + +### Managing externally increment / full backups + +The `backup.sh` scripts accepts a second argument telling it the mode i.e `auto` (same as no arguments) or `full` or `inc` if you wish to manually configure your full / increment backup dates : + +**One MUST** provide the `.env` argument to use the mode argument, for instance + +``` +# Full backup every first saturday of every even month a 20:00 +0 20 * 1,3,5,7,9,11 6 [ $(date +\%d) -le 07 ] && /root/duplicity-ftp-backup/backup.sh /opt/duplicity-ftp-backup/.env full > /var/log/bckp-full.log 2>&1 +# Incremental backup every day a 3 am +0 3 * * * /root/duplicity-ftp-backup/backup.sh /opt/duplicity-ftp-backup/.env inc > /var/log/bckp.log 2>&1 +```