Sentry: errors from the duel server, and cron check-ins for the rollup and backup
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
9bd203ae60
commit
b25abd4d69
@@ -4,8 +4,9 @@
|
||||
# snapshots/ - one dated copy per day, pruned after 90 days
|
||||
# Ledgers are append-only JSONL; the duel server never needs stopping.
|
||||
# Sentry Crons check-in: /root/.waving-hands-sentry-cron holds the check-in
|
||||
# URL (absent file = no check-ins).
|
||||
# URL (absent file = no check-ins). SCHEDULE must match /etc/cron.d/waving-hands.
|
||||
set -u
|
||||
SCHEDULE="23 7 * * *"
|
||||
BUCKET="kestrel-wizwar-backups"
|
||||
PREFIX="waving-hands"
|
||||
SRC="/var/lib/waving-hands"
|
||||
@@ -13,7 +14,11 @@ LOG="/var/log/waving-hands/backup.log"
|
||||
STAMP=$(date +%Y-%m-%d)
|
||||
mkdir -p "$(dirname "$LOG")"
|
||||
CRON_URL=$(cat /root/.waving-hands-sentry-cron 2>/dev/null || true)
|
||||
checkin() { [ -n "$CRON_URL" ] && curl -sf -o /dev/null "$CRON_URL?status=$1" || true; }
|
||||
checkin() {
|
||||
[ -n "$CRON_URL" ] && curl -sf -o /dev/null -X POST -H "Content-Type: application/json" \
|
||||
-d "{\"status\":\"$1\",\"monitor_config\":{\"schedule\":{\"type\":\"crontab\",\"value\":\"$SCHEDULE\"},\"checkin_margin\":30,\"max_runtime\":10,\"timezone\":\"UTC\"}}" \
|
||||
"$CRON_URL" || true
|
||||
}
|
||||
|
||||
if [ ! -s /root/.config/rclone/rclone.conf ]; then
|
||||
echo "$(date -Is) skipped: rclone is not configured" >> "$LOG"
|
||||
|
||||
Reference in New Issue
Block a user