From 1ba42f949765b52a4c6b93392e38ca8d30884281 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Feb 2026 06:41:57 +0000 Subject: [PATCH] docs: document flock + cron approach for email agent scheduling https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ef7a3d..03f8bc9 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# Meister-Eder \ No newline at end of file +# Meister-Eder + +## Running the Email Agent + +The email agent is a plain script invoked periodically via cron — no long-running daemon needed. + +### Scheduling with cron + +```cron +*/5 * * * * flock -n /tmp/meister-eder-email.lock python /path/to/check_email.py +``` + +`flock -n` acquires an exclusive lock before running the script. If a previous run is still in progress when the next cron tick fires, the new invocation exits immediately (non-blocking). The lock is released automatically by the kernel when the process ends — even on crash — so stuck locks are not a concern. + +Adjust `*/5` to whatever polling interval makes sense (e.g. `*/2` for every 2 minutes). \ No newline at end of file