feat: verify scheduled backups

This commit is contained in:
2026-07-19 05:48:12 +08:00
parent 44cd7a48ee
commit 808deaba97
5 changed files with 62 additions and 7 deletions
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
# Installs a daily 03:15 host cron job. Run from WSL after setting an offsite mount if desired.
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
line="15 3 * * * cd $root_dir && BACKUP_RETENTION_DAYS=30 ./scripts/backup.sh >> data/backup-cron.log 2>&1"
(crontab -l 2>/dev/null | grep -Fv "scripts/backup.sh"; echo "$line") | crontab -
printf 'Installed daily backup cron job. Inspect with: crontab -l\n'