neb/skel/opt/scripts/restic/backup.sh

17 lines
No EOL
436 B
Bash

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