Initial resurrection kit — 81 scripts, 62 references, configs, systemd units, crons, Docker compose files, Caddy config, master README
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# run-wisp-backup.sh — Wrapper for cron: sets up env and runs CCR backup via VPN
|
||||
# Called by cron job
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)/wisp-backup"
|
||||
LOG_FILE="$SCRIPT_DIR/../logs/home-router-backup-$(date +%Y-%m-%d).log"
|
||||
|
||||
mkdir -p "$(dirname "$LOG_FILE")"
|
||||
|
||||
echo "=== Home Router Backup $(date -u '+%Y-%m-%d %H:%M:%S UTC') ===" >> "$LOG_FILE"
|
||||
|
||||
cd "$SCRIPT_DIR" || { echo "FAILED: can't cd to $SCRIPT_DIR"; exit 1; }
|
||||
python3 wisp-backup.py "$@" >> "$LOG_FILE" 2>&1
|
||||
|
||||
EXIT_CODE=$?
|
||||
echo "=== Exit code: $EXIT_CODE ===" >> "$LOG_FILE"
|
||||
|
||||
# Only print output if something went wrong — silent on success (watchdog pattern)
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "Home Router Backup FAILED — exit code $EXIT_CODE"
|
||||
tail -20 "$LOG_FILE"
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
Reference in New Issue
Block a user