Compare commits
No commits in common. "main" and "001011ed7615e7204636b91aeb66c9c4f84fe26e" have entirely different histories.
main
...
001011ed76
@ -2,104 +2,63 @@ version: 2
|
|||||||
|
|
||||||
global:
|
global:
|
||||||
forget:
|
forget:
|
||||||
keep-monthly: 1
|
keep-last: 2
|
||||||
|
|
||||||
backends:
|
backends:
|
||||||
hdd:
|
hdd:
|
||||||
type: local
|
type: local
|
||||||
path: /mnt/hdd/autorestic.backup
|
path: /home/yunohost.backup/restic
|
||||||
|
|
||||||
oiseauroch:
|
|
||||||
type: sftp
|
|
||||||
path: backup_oiseauroch:/backup_sagouin/backups
|
|
||||||
|
|
||||||
glacier:
|
|
||||||
type: rclone
|
|
||||||
path: scaleway-glacier:/autorestic-sagou.in
|
|
||||||
|
|
||||||
locations:
|
locations:
|
||||||
databases:
|
databases:
|
||||||
from: /mnt/ssd/backup-working/db-dumps
|
from: /var/backups/working/db-dumps
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
hooks:
|
hooks:
|
||||||
before:
|
before:
|
||||||
- sudo -u postgres /usr/bin/pg_dumpall > /mnt/ssd/backup-working/db-dumps/postgres.dump
|
- sudo -u postgres /usr/bin/pg_dumpall > /var/backups/working/db-dumps/postgres.dump
|
||||||
- /usr/bin/mysqldump --all-databases > /mnt/ssd/backup-working/db-dumps/mysql.dump
|
- sudo /usr/bin/mysqldump --all-databases > /var/backups/working/db-dumps/mysql.dump
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
from:
|
from:
|
||||||
- /etc
|
- /etc
|
||||||
|
- /home/yunohost.conf
|
||||||
- /var/spool/cron/crontabs/
|
- /var/spool/cron/crontabs/
|
||||||
- /opt/yunohost/wireguard/db/
|
- /opt/yunohost/wireguard/db/
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
|
||||||
options:
|
|
||||||
forget:
|
|
||||||
keep-weekly: 5
|
|
||||||
|
|
||||||
bludit:
|
|
||||||
from:
|
|
||||||
- /var/www/bludit/bl-content/pages/
|
|
||||||
to:
|
|
||||||
- hdd
|
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
options:
|
options:
|
||||||
forget:
|
forget:
|
||||||
keep-weekly: 5
|
keep-weekly: 5
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
from: /mnt/ssd/backup-working/gitea
|
from: /var/backups/working/gitea
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
hooks:
|
hooks:
|
||||||
before:
|
before:
|
||||||
- sudo -u gitea /var/www/gitea/gitea dump -f - > /mnt/ssd/backup-working/gitea/gitea.zip
|
- sudo -u gitea /opt/gitea/gitea dump -f /var/backups/working/gitea/gitea.zip
|
||||||
|
|
||||||
home:
|
home:
|
||||||
from:
|
from:
|
||||||
- /home/agathe
|
|
||||||
- /home/antoine
|
- /home/antoine
|
||||||
- /home/baptiste
|
- /home/baptiste
|
||||||
- /home/con
|
- /home/con
|
||||||
- /home/josephine
|
|
||||||
- /home/mariage
|
|
||||||
- /home/marieclaire
|
|
||||||
- /home/oiseauroch
|
|
||||||
- /home/raphaeldutrieux
|
|
||||||
- /home/roxane
|
- /home/roxane
|
||||||
- /home/shrek
|
|
||||||
- /home/thomas
|
- /home/thomas
|
||||||
|
- /home/tobias
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
|
|
||||||
nextcloud:
|
nextcloud:
|
||||||
from:
|
from:
|
||||||
- /home/yunohost.app/nextcloud
|
- /home/yunohost.app/nextcloud
|
||||||
options:
|
|
||||||
backup:
|
|
||||||
exclude:
|
|
||||||
- '**/cache'
|
|
||||||
- '**/files_versions'
|
|
||||||
- '**/files_trashbin'
|
|
||||||
- '**/appdata_ocfigi57i0ri'
|
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
#hooks:
|
#hooks:
|
||||||
#before:
|
#before:
|
||||||
@ -107,15 +66,15 @@ locations:
|
|||||||
#after:
|
#after:
|
||||||
#- sudo -u www-data php occ maintenance:mode --off
|
#- sudo -u www-data php occ maintenance:mode --off
|
||||||
|
|
||||||
bookstack:
|
dokuwiki:
|
||||||
from:
|
from:
|
||||||
- /var/www/bookstack/.env
|
- /var/www/dokuwiki/conf
|
||||||
- /var/www/bookstack/public/uploads
|
- /var/www/dokuwiki/data/pages
|
||||||
- /var/www/bookstack/storage/uploads
|
- /var/www/dokuwiki/data/meta
|
||||||
|
- /var/www/dokuwiki/data/media
|
||||||
|
- /var/www/dokuwiki/data/media_meta
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
@ -123,20 +82,11 @@ locations:
|
|||||||
- /var/mail
|
- /var/mail
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
|
|
||||||
# All multimedia folders but the shared (separate location)
|
|
||||||
multimedia:
|
multimedia:
|
||||||
from:
|
from:
|
||||||
- /home/yunohost.multimedia/
|
- /home/yunohost.multimedia/
|
||||||
options:
|
|
||||||
backup:
|
|
||||||
exclude:
|
|
||||||
- '/home/yunohost.multimedia/share'
|
|
||||||
to:
|
to:
|
||||||
- hdd
|
- hdd
|
||||||
- oiseauroch
|
cron: '0 3 1 * *' # At 3:00am on the 1st
|
||||||
- glacier
|
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
|
||||||
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.autorestic.env
|
||||||
|
.autorestic.lock.yml
|
BIN
.runforget.swp
Normal file
BIN
.runforget.swp
Normal file
Binary file not shown.
13
README.md
13
README.md
@ -1,15 +1,4 @@
|
|||||||
# Backup
|
# Backup
|
||||||
|
|
||||||
Configuration (autorestic, cron) for the backup of [sagou.in](sagou.in).
|
Configuration (autorestic, cron) for the backup of [sagou.in](sagou.in).
|
||||||
Refer to the [dedicated wiki page](https://wiki.sagou.in/tech:backup#autorestic).
|
Refer to the [dedicated wiki page](https://wiki.rockpro.ynh.fr/tech:backup#autorestic).
|
||||||
|
|
||||||
## Installation
|
|
||||||
To install, clone the repo, create the `/etc/autorestic` folder and symbolically link
|
|
||||||
```bash
|
|
||||||
git clone https://git.sagou.in/sagou.in/Autorestic
|
|
||||||
cd Autorestic
|
|
||||||
mkdir /etc/autorestic
|
|
||||||
ln -s $(pwd)/autorestic/{.autorestic.yml,runcron,runforget} /etc/autorestic
|
|
||||||
```
|
|
||||||
|
|
||||||
Once initialized, move the repository keys into a `/etc/autorestic/.autorestic.env` file as described in [the doc](https://autorestic.vercel.app/backend/env).
|
|
10
runcron
10
runcron
@ -1,13 +1,13 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
autorestic -c /etc/autorestic/.autorestic.yml --ci cron 1> /tmp/autorestic.log 2>/tmp/autorestic-err.log
|
autorestic -c /etc/autorestic/.autorestic.yml --ci cron --lean 1> /tmp/autorestic.log 2>/tmp/autorestic-err.log
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
if [[ "$ret" != 0 || -s /tmp/autorestic-err.log ]]
|
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-err.log ]
|
||||||
then
|
then
|
||||||
cat <(echo "Command failed with return code $ret and log:") /tmp/autorestic-err.log <(echo "===============") /tmp/autorestic.log | mail -s "Autorestic Backup: Failed" root
|
printf "Command failed with return code $ret and log:\n$(cat /tmp/autorestic-err.log)" | mail -s "Autorestic Backup: Failed" root
|
||||||
else
|
else
|
||||||
if [[ $(wc -l < /tmp/autorestic.log) -gt 15 ]]
|
if [ -s /tmp/autorestic.log ]
|
||||||
then
|
then
|
||||||
cat <(echo -e "Command successfully finished with the following log:") /tmp/autorestic-err.log <(echo "===============") /tmp/autorestic.log | mail -s "Autorestic Backup: Success" root
|
printf "Command successfully finished with the following log:\n$(cat /tmp/autorestic.log)" | mail -s "Autorestic Backup: Success" root
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
autorestic -c /etc/autorestic/.autorestic.yml --ci forget --all --prune 1> /tmp/autorestic-prune.log 2>/tmp/autorestic-prune-err.log
|
autorestic -c /etc/autorestic/.autorestic.yml --ci forget --all --prune 1> /tmp/autorestic-prune.log 2>/tmp/autorestic-prune-err.log
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
if [[ "$ret" != 0 || -s /tmp/autorestic-prune-err.log ]]
|
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-prune-err.log ]
|
||||||
then
|
then
|
||||||
cat <(echo "Command failed with return code $ret and log:") /tmp/autorestic-prune-err.log <(echo "===============") /tmp/autorestic-prune.log | mail -s "Autorestic Pruning: Failed" root
|
printf "Command failed with return code $ret and log:\n$(cat /tmp/autorestic-prune-err.log)" | mail -s "Autorestic Pruning: Failed" root
|
||||||
else
|
else
|
||||||
cat <(echo "Command successfully finished with the following log:") /tmp/autorestic-prune.log | mail -s "Autorestic Pruning: Success" root
|
printf "Command successfully finished with the following log:\n$(cat /tmp/autorestic-prune.log)" | mail -s "Autorestic Pruning: Success" root
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user