Add automated Restic backups for edge01

This commit is contained in:
2026-07-27 22:40:58 -04:00
parent b12e0fd163
commit 7daba4343e
8 changed files with 101 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
source /etc/restic/edge01.env
exec 9>/run/restic-edge01.lock
if ! flock -n 9; then
echo "Another Restic operation is already running."
exit 1
fi
echo "Starting Restic retention at $(date --iso-8601=seconds)"
restic forget \
--host edge01 \
--tag automatic \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 12 \
--prune
echo "Retention completed at $(date --iso-8601=seconds)"