From 9d52d869fbd27f2a46c354eb6e93b4f7d3b33c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 9 Sep 2026 13:50:22 +0200 Subject: [PATCH] skip @reboot line for cron --- api/scrape_schedule.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/scrape_schedule.py b/api/scrape_schedule.py index e584219..699a987 100644 --- a/api/scrape_schedule.py +++ b/api/scrape_schedule.py @@ -62,13 +62,18 @@ def discover_cron_expr(command_hint: str, *, archive: bool) -> Optional[str]: ``command_hint`` is a substring identifying the scrape command (e.g. "scraper.py"); ``archive`` picks the "--archive" line vs. the plain one. - Returns None if the crontab can't be read or no line matches. + Each scrape typically has two crontab lines - an "@reboot" one and a + timed one; "@reboot" isn't a recurring schedule (croniter can't compute + a next run from it), so it's skipped in favor of the timed line. + Returns None if the crontab can't be read or no timed line matches. """ for line in _read_crontab_lines(): parsed = _parse_crontab_line(line) if parsed is None: continue schedule, command = parsed + if schedule.lower() == "@reboot": + continue if command_hint not in command: continue if ("--archive" in command) != archive: