One day I was reading the source of scron and all the parsing made me unhappy, so I set out to write my own cron daemon that hopefully sucks less. This is what I came up with.
ccrond is a daemon that runs commands periodically. The crontab is defined in the C language, meaning there is no file parsing and allowing for minimal memory usage and very simple code.
Here's an example crontab file:
START_CRONTAB
DO downloadNews EVERY 30 MINUTES
DO syncMirror EVERY 10 HOURS
DO cleanCache EVERY 6 MINUTES
DO backupSysConfig EVERY 2 DAYS AND 20 MINUTES
DO backupMail EVERY 5 DAYS AND 7 HOURS
DO backupMedia EVERY 6 WEEKS
END_CRONTAB
Those verbs are actually C functions, but calling system() in them is a fine approach.
I have written about it in
gemini://expert.chickenkiller.com/project/ccrond/index.gmi
And I have published the source code at
git://expert.chickenkiller.com/ccrond.git
I've also made the first patch to get us started. Feel free to tell me what you think, list it in
https://suckless.org/rocks/ and send patches.
Rodrigo.
Received on Tue May 17 2022 - 22:25:21 CEST