6ebe95c13e
gates / gates (push) Successful in 41s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
20 lines
1.1 KiB
Python
20 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Part C step 1 on 9202: move the backup window forward (the product's own form, POST /backups/window) so the
|
|
night chain runs now: db-dump at W, Tier 2 at W+60, off-site at W+105 (9202 has none), gate at W+2h."""
|
|
import sys, time, json
|
|
sys.path.insert(0, ".")
|
|
import walk as w
|
|
W = sys.argv[1]
|
|
w.login()
|
|
before = w.guest("docker logs --since 20h felhom-controller 2>&1 | grep 'Daily job' | tail -3").strip()
|
|
w.say("before:\n" + before)
|
|
sess = open(f"{w.SC}/sess{__import__('os').getpid()}.txt").read().strip()
|
|
csrf = open(f"{w.SC}/csrf{__import__('os').getpid()}.txt").read().strip()
|
|
r = w.sh(["curl", "-sk", "-o", "/dev/null", "-w", "%{http_code}", "-H", w.HOSTHDR, "-H", f"Cookie: {sess}", "-X", "POST",
|
|
"--data-urlencode", f"_csrf={csrf}", "--data-urlencode", f"window_start={W}", f"{w.BASE}/backups/window"])
|
|
w.say(f"POST /backups/window window_start={W} -> {r.stdout}")
|
|
time.sleep(3)
|
|
after = w.guest("docker logs --since 2m felhom-controller 2>&1 | grep -E 'Daily job|window' | tail -6").strip()
|
|
w.say("after:\n" + after)
|
|
open("../C/10-window-moved.txt", "w").write("\n".join(w.LOG) + "\n")
|