|
|
|
|
|
by jeroenhd
9 days ago
|
|
Having had to work on an application supposedly supporting cron expressions: the numbers are just the basic parts of the language. When someone inputs something ridiculous like "5,3/4 4-8,11 1 4,5,6,9-11 */2" you get to enjoy the fun of reverse engineering what they meant (it's never what they actually wrote). And that's before you get to all the extensions supported in some cron environments (but not all). I find systemd timers a lot more manageable. Things like having control over whether or not long-running jobs are allowed to overlap and the ability to run tasks between start-finish rather than a fixed time window are major improvements for me. At some point my VPS went down because the backup job ran into some kind of symlink loop and cron just kept spawning more and more backup tasks even though none of them finished. Having to re-write commands and scripts because CRON had its own special PATH was also a pain point, but the same can be true for some types of systemd timers. But: you can execute those timers manually if you want instead of updating the crontab to trigger in 30 seconds and simply waiting. |
|
Is your example (which I agree, looks cryptic) any less cryptic in systemd?
I asked jippity, and it said this:
To which I have to go: "what?"> Things like having control over whether or not long-running jobs are allowed to overlap
With cron that's just prefixing the command with `flock -n <lock>`, but sure the "pick somewhere to put the lock" is probably better with systemd.
> Having to re-write commands and scripts because CRON had its own special PATH
Why? Wouldn't you just put that in the crontab? I don't even see this as different. It's in the cron config or the systemd timer config.
The other improvements you mentioned seem good.