From 9786e9df7904a54941763597f3c5c8af37cb3f13 Mon Sep 17 00:00:00 2001 From: Antoine Lima Date: Tue, 23 Nov 2021 23:12:59 +0100 Subject: [PATCH] First autorestic configuration --- .autorestic.yml | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ README.md | 3 +- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .autorestic.yml create mode 100644 .gitignore diff --git a/.autorestic.yml b/.autorestic.yml new file mode 100644 index 0000000..580f8c1 --- /dev/null +++ b/.autorestic.yml @@ -0,0 +1,92 @@ +version: 2 + +global: + forget: + keep-last: 2 + +backends: + hdd: + type: local + path: /home/yunohost.backup/restic + +locations: + databases: + from: /var/backups/working/db-dumps + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + hooks: + before: + - sudo -u postgres /usr/bin/pg_dumpall > /var/backups/working/db-dumps/postgres.dump + - sudo /usr/bin/mysqldump --all-databases > /var/backups/working/db-dumps/mysql.dump + + configs: + from: + - /etc + - /home/yunohost.conf + - /var/spool/cron/crontabs/ + - /opt/yunohost/wireguard/db/ + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + options: + forget: + keep-weekly: 5 + + gitea: + from: /var/backups/working/gitea + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + hooks: + before: + - sudo -u gitea /opt/gitea/gitea dump -f /var/backups/working/gitea/gitea.zip + + home: + from: + - /home/antoine + - /home/baptiste + - /home/con + - /home/roxane + - /home/thomas + - /home/tobias + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + + nextcloud: + from: + - /home/yunohost.app/nextcloud + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + #hooks: + #before: + #- sudo -u www-data php occ maintenance:mode --on # Lock new logins + #after: + #- sudo -u www-data php occ maintenance:mode --off + + dokuwiki: + from: + - /var/www/dokuwiki/conf + - /var/www/dokuwiki/data/pages + - /var/www/dokuwiki/data/meta + - /var/www/dokuwiki/data/media + - /var/www/dokuwiki/data/media_meta + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + + mail: + from: + - /var/mail + to: + - hdd + cron: '0 3 * * 4' # At 3:00am on Thursday + + home: + from: + - /home/yunohost.multimedia/ + to: + - hdd + cron: '0 3 1 * *' # At 3:00am on the 1st diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..60178c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.autorestic.env +.autorestic.lock.yml \ No newline at end of file diff --git a/README.md b/README.md index 067809b..7f566bc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Backup -Configuration (autorestic, cron) for the backup of sagou.in \ No newline at end of file +Configuration (autorestic, cron) for the backup of [sagou.in](sagou.in). +Refer to the [dedicated wiki page](https://wiki.rockpro.ynh.fr/tech:backup#autorestic). \ No newline at end of file