Skip to content
Snippets Groups Projects
Select Git revision
2 results Searching

Readme.md

Blame
  • David Beniamine's avatar
    David Beniamine authored
    e1410a15
    History

    Duplicity-backup

    Duplicity based backup for ftp servers

    Install

    apt-get install duplicity lftp
    cd /opt
    git clone https://gitlab.tetras-libre.fr/nocloud/duplicity-ftp-backup
    cp .env.sample .env

    Adapt .env

    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