5 ms·
> OnCalendar=weekly What's that mean though? It's entirely meaningless unless you, what's that, check the manual. Or what if you want it to run on another day?
by jimktrains2 8y ago
> OnCalendar=weekly
What's that mean though? It's entirely meaningless unless you, what's that, check the manual. Or what if you want it to run on another day? What's that? Check the manual? Sound familiar?
- userbinator 8y agoWhat'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 8y agoMonday at midnight, pretty simple. If you care what day/time the "weekly" event occurs at, the "weekly" literal is not for you.
- jimktrains2 8y ago> Monday at midnight, pretty simple Why is that simple? Monday isn't even the first day of the week!
- tscs37 8y 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 8y 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 8y 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 8y 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 8y 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 8y 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.