2023-10-18 01:31:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-10-18 01:57:15 +02:00
|
|
|
ntfy() {
|
2023-10-18 20:58:24 +02:00
|
|
|
sh /opt/scripts/ntfy.sh -s "/neb/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
|
2023-10-18 01:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ntfy -m "performing backup..."
|
2023-10-18 01:31:05 +02:00
|
|
|
if restic \
|
2023-10-18 22:50:49 +02:00
|
|
|
-r "/mnt/backup/restic/$(hostname)" \
|
2023-10-18 01:31:05 +02:00
|
|
|
-p "/neb/secrets/restic/$(hostname).secret" \
|
|
|
|
backup \
|
|
|
|
--tag auto \
|
|
|
|
/srv /home /etc; then
|
2023-10-18 01:57:15 +02:00
|
|
|
ntfy -m "backup succeeded"
|
2023-10-18 01:31:05 +02:00
|
|
|
else
|
2023-10-18 01:57:15 +02:00
|
|
|
ntfy -m "backup failed" -e "warning,skull"
|
2023-10-18 01:31:05 +02:00
|
|
|
fi
|