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

15 lines
No EOL
398 B
Bash
Executable file

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