byCaliber Tools · Crons

Crons

byCaliber automation surface · backup worker + watchdog

Worker code: ~/Projects/bycaliber-backup-worker/ · deployed at bycaliber-backup-worker.alexandre-corne-ac.workers.dev

5 crons live. Manual trigger buttons below hit the worker's admin endpoints directly (no auth on these endpoints — fail-closed via guards in code).

Sister page on byCaliber: tools.bycaliber.work/crons. Reference on EO: tools.eliteoutsiders.com/crons.

LIVE = deployed and triggering silent = no mail if no breach (no spam) backup-first = R2 fail blocks DELETE (zero data loss)

CRON1 — D1 backup

LIVE MONTHLY
Schedule: 0 3 1 * * (1st of month @ 03:00 UTC)
  • Dumps every business table from D1 bycaliber as a single SQL file (CREATE TABLE + INSERT per row).
  • Uploads to R2 bucket bycaliber-backups under prefix YYYY-MM/d1-bycaliber-YYYY-MM-DD.sql.
  • Guards: if DB or BACKUP_BUCKET binding missing → graceful exit with summary.

CRON5 — events archive

LIVE MONTHLY
Schedule: 0 2 1 * * (1st of month @ 02:00 UTC, 1h before backup)
  • Archives previous-month events from D1 events table to R2 (events-archive/YYYY-MM/events-archive-YYYY-MM-DD.json).
  • Backup-first: R2 upload must succeed before DELETE. R2 fail = HARD, DELETE blocked.
  • DELETE clause: created_at < currentMonthStart. Current month always preserved.
  • Brevo recap email (skipped silently if BREVO_API_KEY missing).

CRON6 — page-flow crawler

LIVE WEEKLY
Schedule: 0 4 * * 1 (Monday @ 04:00 UTC)
  • Fetches bycaliber.com/sitemap.xml, walks every public page.
  • Extracts every clickable element (<a>, <button>, [role="button"], [data-track-id]).
  • Upserts D1 tables page_inventory + button_inventory on (page_path, fingerprint). Keeps history via first_seen_at + last_seen_at.
  • Stale-cleanup: paths removed from sitemap → DELETE rows. Skipped if sitemap fetch failed (no accidental wipe).
  • Last run indexed 13 pages + 121 buttons.

CRON7 — URL audit

LIVE MONTHLY
Schedule: 0 4 1 * * (1st of month @ 04:00 UTC, 1h after backup)
  • Auto-baseline from bycaliber.com/sitemap.xml (no hardcoded list to maintain).
  • Crawls each URL, buckets results: 200/3xx = OK, 4xx = warn, 5xx/0 = error.
  • Brevo mail if any anomalies, silent if all OK.

CRON11 — error_events watchdog

LIVE DAILY
Schedule: 0 6 * * * (every day @ 06:00 UTC)
  • Queries D1 error_events for rows in last 24h.
  • If count = 0 → silent (no spam). If count > 0 → Brevo alert email with breakdown by level + source + status + path.
  • Guards: if BREVO_API_KEY missing → warning log, no crash. Watchdog still runs.

Pending crons (from EO audit, not yet ported):

Mutualized on EO (already covers byCaliber + byCaliber Cal.com slots):