First autorestic configuration

This commit is contained in:
Antoine Lima 2021-11-23 23:12:59 +01:00
parent e28f93c5d1
commit 9786e9df79
3 changed files with 96 additions and 1 deletions

92
.autorestic.yml Normal file
View File

@ -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

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.autorestic.env
.autorestic.lock.yml

View File

@ -1,3 +1,4 @@
# Backup
Configuration (autorestic, cron) for the backup of sagou.in
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).