neb/skel/opt/scripts/restic/backup.sh
2023-10-18 22:50:49 +02:00

17 lines
No EOL
408 B
Bash

#!/bin/sh
ntfy() {
sh /opt/scripts/ntfy.sh -s "/neb/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
}
ntfy -m "performing backup..."
if restic \
-r "/mnt/backup/restic/$(hostname)" \
-p "/neb/secrets/restic/$(hostname).secret" \
backup \
--tag auto \
/srv /home /etc; then
ntfy -m "backup succeeded"
else
ntfy -m "backup failed" -e "warning,skull"
fi