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

15 lines
409 B
Bash
Raw Normal View History

2023-10-18 01:31:05 +02:00
#!/bin/sh
2023-10-18 01:57:15 +02:00
ntfy() {
2023-10-18 23:02:18 +02:00
sh /opt/scripts/ntfy.sh -s "/etc/ixvd/secrets/ntfy/ixvd-backups" -u "https://push.ixvd.net/ixvd-backups" "$@"
2023-10-18 01:31:05 +02:00
}
2023-10-18 23:07:17 +02:00
ntfy -m "pruning old backups..." -p "urgent"
2023-10-18 01:57:15 +02:00
if restic \
2023-10-18 22:50:49 +02:00
-r "/mnt/backups/restic/$(hostname)" \
2023-10-18 01:57:15 +02:00
-p "/etc/ixvd/secrets/restic/$(hostname).secret" \
prune; then
notify -m "pruning succeeded"
else
2023-10-18 23:07:17 +02:00
notify -m "prune failed" -e "warning,skull" -p "urgent"
2023-10-18 01:57:15 +02:00
fi