Re-enable eustachius restic backup & fix notifications

This commit is contained in:
GHOSCHT 2024-07-05 15:42:02 +02:00
parent e5d4bffe8d
commit f4725f1030
Signed by: ghoscht
GPG key ID: 2C2C1C62A5388E82

View file

@ -37,7 +37,7 @@ in {
services.cron = {
enable = true;
systemCronJobs = [
"*/5 * * * * root . /etc/profile; autorestic -c /home/ghoscht/.autorestic.yml --ci cron"
"*/5 * * * * root . /etc/profile; autorestic -c /home/ghoscht/.autorestic.yml --ci cron > /var/log/autorestic-bin.log"
];
};
@ -70,10 +70,10 @@ in {
extras:
default_hooks: &default_hooks
success:
- 'curl -H "Authorization: Bearer ${config.sops.placeholder."autorestic/ntfy_access_token"}" -H "X-Tags: white_check_mark" -H "X-Title: Backup of location $AUTORESTIC_LOCATION successful" -d "Added $AUTORESTIC_FILES_ADDED_0 files and changed $AUTORESTIC_FILES_CHANGED_0 files with a total size of $AUTORESTIC_ADDED_SIZE_0. Processed $AUTORESTIC_PROCESSED_FILES_0 files with total size $AUTORESTIC_PROCESSED_SIZE_0 in $AUTORESTIC_PROCESSED_DURATION_0. Snapshot $AUTORESTIC_SNAPSHOT_ID_0" https://push.ghoscht.com/autorestic-log'
- echo "Backup of $AUTORESTIC_LOCATION successful! Added $AUTORESTIC_FILES_ADDED_0 files and changed $AUTORESTIC_FILES_CHANGED_0 files with a total size of $AUTORESTIC_ADDED_SIZE_0. Processed $AUTORESTIC_PROCESSED_FILES_0 files with total size $AUTORESTIC_PROCESSED_SIZE_0 in $AUTORESTIC_PROCESSED_DURATION_0. Snapshot $AUTORESTIC_SNAPSHOT_ID_0" >> /var/log/autorestic-backup.log
failure:
- echo "Backup of $AUTORESTIC_LOCATION failed" >> /var/log/autorestic.log
- 'curl -H "Authorization: Bearer ${config.sops.placeholder."autorestic/ntfy_access_token"}" -H "X-Tags: warning" -H "X-Title: Backup Failure" -d "Backup of location $AUTORESTIC_LOCATION failed" https://push.ghoscht.com/autorestic'
- 'curl -H "Authorization: Bearer ${config.sops.placeholder."autorestic/ntfy_access_token"}" -H "X-Tags: warning" -H "X-Title: Backup Failure" -d "Backup of location $AUTORESTIC_LOCATION failed" https://push.ghoscht.com/autorestic-log'
locations:
dashboard:
@ -93,7 +93,7 @@ in {
to:
- zfs
- ssd
# - eustachius
- eustachius
cron: '0 4 * * 0' # Every Sunday at 4:00
hooks:
<<: *default_hooks
@ -118,7 +118,7 @@ in {
to:
- zfs
- ssd
# - eustachius
- eustachius
cron: '0 4 * * *' # Every Day at 4:00
hooks:
<<: *default_hooks
@ -169,7 +169,7 @@ in {
to:
- zfs
- ssd
# - eustachius
- eustachius
cron: '0 4 * * *' # Every Day at 4:00
hooks:
<<: *default_hooks
@ -189,17 +189,17 @@ in {
- arion -f ${arionPath}/matrix/arion-compose.nix -p ${arionPath}/matrix/arion-pkgs.nix stop
after:
- arion -f ${arionPath}/matrix/arion-compose.nix -p ${arionPath}/matrix/arion-pkgs.nix start
# music:
# from: /storage/dataset/data/media/music
# to:
# - eustachius
# cron: '0 4 * * 0' # Every Sunday at 4:00
# hooks:
# <<: *default_hooks
# before:
# - arion -f ${arionPath}/media/arion-compose.nix -p ${arionPath}/media/arion-pkgs.nix stop
# after:
# - arion -f ${arionPath}/media/arion-compose.nix -p ${arionPath}/media/arion-pkgs.nix start
music:
from: /storage/dataset/data/media/music
to:
- eustachius
cron: '0 4 * * 0' # Every Sunday at 4:00
hooks:
<<: *default_hooks
before:
- arion -f ${arionPath}/media/arion-compose.nix -p ${arionPath}/media/arion-pkgs.nix stop
after:
- arion -f ${arionPath}/media/arion-compose.nix -p ${arionPath}/media/arion-pkgs.nix start
headscale:
from: /storage/dataset/docker/headscale
to:
@ -216,7 +216,7 @@ in {
to:
- zfs
- ssd
# - eustachius
- eustachius
cron: '55 3 * * *' # Every Day at 3:55
hooks:
<<: *default_hooks
@ -233,10 +233,10 @@ in {
type: local
path: /home/ghoscht/Backups
key: '${config.sops.placeholder."autorestic/ssd_key"}'
# eustachius:
# type: rest
# path: http://100.64.0.3:8000/Backups
# key: '${config.sops.placeholder."autorestic/eustachius_key"}'
eustachius:
type: rest
path: http://100.64.0.3:8000/franz
key: '${config.sops.placeholder."autorestic/eustachius_key"}'
'';
};
}