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

15 lines
No EOL
409 B
Bash

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