7 ms·
What's that mean though? In particular: which day of the week, and at what time? cron expressions have about as much learning curve as ISO-8601, and are other
by userbinator 9y ago
What's that mean though?
In particular: which day of the week, and at what time?
cron expressions have about as much learning curve as ISO-8601, and are otherwise unambiguous once you know how to read them. systemd's time specifications look like they're full of special cases:
https://www.freedesktop.org/software/systemd/man/systemd.time.html https://www.freedesktop.org/software/systemd/man/systemd.tim...
- otterley 9y agoMonday at midnight, pretty simple. If you care what day/time the "weekly" event occurs at, the "weekly" literal is not for you.
- jimktrains2 9y ago> Monday at midnight, pretty simple Why is that simple? Monday isn't even the first day of the week!
- tscs37 9y agoMonday is first day of the week according to ISO 8601. This is also the case in most European countries. In the middle east Saturday would be the first day and in some countries (notable North American and Islamic) it's Sunday. But ISO 8601 is the standard so it makes sense to use that.
- jimktrains2 9y agoSure, but there is nothing telling me it's adhearing to 8601 in that snippet. Why isn't it using the tm struct where Sunday = 0? I, what's that?, Have to check the documentation? ::gasp:: just like if you forget the order of the cron tab columns...
- tscs37 9y agoIt's pretty intuitive once you've done it twice unlike cron's impenetrable syntax, tbh. They also have other desirable behavior like being able to configure it concurrent runs are allowed or if the script should run if the initial date was missed or even restart the job if it fails up to a limit. It's much more versatile than simply cron, due to that, it's also a lot more useful.
- jimktrains2 9y agohttps://www.freedesktop.org/software/systemd/man/systemd.time.html https://www.freedesktop.org/software/systemd/man/systemd.tim... is 1300+ words. https://www.freebsd.org/cgi/man.cgi?crontab(5) https://www.freebsd.org/cgi/man.cgi?crontab(5) is 1400 or so. I'd hardly call that impenetrable. Additionally you will note that free bad has an extension to the format for shortcuts like monthly, weekly, &c.
- tscs37 9y agoI'm aware of the extension but Systemd Timers have RandomizedDelaySec which allows me to schedule nightly backups without having to coordinate about 20 different machines into timeslots. I should note that `man crontab | wc` returns 1680 words while `man systemd.timer | wc` returns 1300 words. Take that for what you while, especially since .timer spends most words on explaining the options instead of the syntax.
- jimktrains2 9y agoThere's little functional difference between syntax and options in this case, as the options in systemd serve the same purpose as the syntax iin crontab. I just don't want cron doing randomized delay and repeats. That should functionally be determined by the application.
- tscs37 9y ago>I just don't want cron doing randomized delay and repeats. That should functionally be determined by the application. I think it's perfectly fine that timer does this, it's useful. The applications I run don't support this behaviour out of the box, so why should I have to code up something for each app? >There's little functional difference between syntax and options in this case, There is an important difference. The manpage on timers spends most words explaining what exactly each option does and how it can be useful while most of the crontab manpage explains how the syntax works, the options crontab provides are minimal.