Hi,
the attached patch provides some initial fcron-like func-
tionality. Given a crontab of:
| %daily */7 * echo daily
| %weekly */23 * echo weekly
| %hourly */3 echo hourly
it will run:
1. "echo daily" once per calendar day, on the first possi-
bility of minute % 7 == 0,
2. "echo weekly" once per calendar week (Monday to Sunday),
on the first possibility of minute % 23 == 0, and
3. "echo hourly" once per hour, on the first possibility of
minute % 3 == 0.
Periods are reset when crond is started. I haven't actually
tested the daily/weekly bits thoroughly as I didn't want to
wait :-). I didn't get the indentation quite right as TABs
are pure evil.
I'd like to push this to fedorahosted.org in a branch to
ease collaboration and thus have applied for the gitcronie
group.
In further development, besides writing documentation,
I'll add a state file in /var/lib that saves the times of
last execution over a reset. For that I'd like to survey
what in users' views makes a job "unique". I. e., should
the time of last execution of "%daily */7 * echo daily" be
based besides the user name on the command ("echo daily"),
the command and flattened schedule ("echo daily",
"0:00/0:07/0:14/0:21/etc."), the literal crontab line or
something else? This is not only interesting for restarts,
but also for user crontab reloads.
Tim