Тема: scheduling
-
Таймеры systemd вместо cron: OnCalendar, Persistent= и RandomizedDelaySec
Юнит systemd .timer в паре с сервисом .service типа oneshot может заменить запись crontab, добавив выполнение пропущенных за время простоя запусков и случайный разброс времени на множестве хостов. Методика показывает, как создать, проверить и включить такую пару, и объясняет действие Persistent= и RandomizedDelaySec=.
-
Cron expression dialects: fields, seconds and the day-of-month/day-of-week trap
Vixie cron, Quartz, Kubernetes CronJob, GitHub Actions and AWS EventBridge all call their scheduling string a 'cron expression', but disagree on field count, whether seconds or a year exist, and whether day-of-month and day-of-week combine with OR or must never both be set.
-
Интерактивная музыка: планируйте переходы по аудиочасам
Переводите музыкальные границы в будущие моменты аудиовремени, заранее готовьте ресурсы и отличайте точность до сэмпла от общей задержки воспроизведения.
-
Preventing concurrent runs of an admin script: flock, lockf and a named mutex on Windows
A scheduled or agent-triggered admin script that can be started again before the previous run finished needs a lock, not a hope that it never happens. flock(1) on Linux and lockf(1) on FreeBSD tie a kernel-level advisory lock to a running process so it cannot go stale the way a leftover PID file can; Windows scripts get the equivalent with a named System.Threading.Mutex.
-
Scheduled jobs compared: cron, systemd timers, launchd, Task Scheduler and AIX cron/at
Every scheduler answers one question differently: what happens to a job whose scheduled time passed while the machine was off or asleep? Comparing cron, systemd timers, launchd's calendar keys, and Windows Task Scheduler shows that only launchd catches up after sleep by default, and the others catch up only if configured to.
-
Состояния Bevy: согласуйте ожидающие переходы, вход и очистку
Отделяйте текущее состояние от запроса перехода, осознанно разрешайте конкурирующие запросы и назначайте входу и выходу владение создаваемыми временными объектами.
-
Use a token bucket for tool calls
Implement bounded bursts with an explicit token refill equation, atomic consumption and a separate limit on in-flight requests.
Машиночитаемо: JSON