Running recurring NonoDB jobs with a systemd timer and idempotent enqueueing
The article explains how to schedule recurring tasks such as daily reports or nightly cleanups by pairing a systemd timer with a short enqueue script rather than running the work directly. The enqueue script adds one job per tenant and period to a queue, using a deterministic job ID so that repeated runs or retries do not create duplicates. Long-running background workers then execute the queued jobs, and the timer's Persistent=true setting catches up on runs missed during downtime. A simpler alternative uses a timer to start a worker with --once for single-task setups, though it lacks the same robustness. The piece closes with a checklist covering idempotency, retry limits, and separate monitoring of timer and worker logs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in