6 ms·
Some cron implementations do, it's not portable.
by caiusdurling 3y ago
Some cron implementations do, it's not portable.
- bheadmaster 3y agoNeither are systemd timers. I don't think there's a single system out there implementing the systemd timer interface.
- dale_glass 3y agoWhat do you mean? There's a single implementation as far as I know, deployed on many distributions and working identically.
- bheadmaster 3y ago> There's a single implementation as far as I know That's exactly what I mean. Systemd itself, including timers, is deeply coupled with the Linux API, and cannot be (easily) ported on any other system. Cron, on the other hand, exists on almost every UNIX-like system.
- yau8edq12i 3y agoI'm sure the few people who run BSD systems will be fine with cron's arcane syntax.
- bheadmaster 3y agoPortable has a well-defined meaning. You can argue that no other system matters (which I strongly disagree with for reasons I don't want to get into right now), but that doesn't make systemd timers any more portable.
- cjaybo 3y agoI’d argue that the degree of portability implied by the term is very much context dependent. “Portable between Linux systems” is a perfectly valid use of the term, imo. Do you take portable to mean a program that can run on every processor arch and OS available?
- bheadmaster 3y ago> Do you take portable to mean a program that can run on every processor arch and OS available? The definition of the word "portable" is not the point of this comment thread (although if you want to hear my definition, see the reply to a sibling comment). Let's take the context into account: > hashworks: While I support systemd timers over cron, AFAIK cron has stuff like @hourly. > caiusdurling: Some cron implementations do, it's not portable. > bheadmaster: Neither are systemd timers. I don't think there's a single system out there implementing the systemd timer interface. User caiusdurling said @hourly is not portable between cron implementations as a way to discredit hashworks' argument about cron having @hourly. However, that's a disingenious argument, because systemd timers aren't any more portable than cron implementations that use @hourly - in fact, there isn't a single system out there implementing the systemd timer interface except systemd.
- yau8edq12i 3y agoOkay, can you define precisely what portable means?
- bheadmaster 3y agoPortable means easy to make it work while changing the underlying system or its implementation details - where the underlying system refers to architecture, OS, API or any other dependencies needed to run the program. In context of systemd, systemd isn't portable because it highly depends on Linux API and thus cannot be ported on any other UNIX-like (or unlike) OS. In context of systemd timers, systemd timers aren't portable because there isn't as single alternative implementation that can interpret systemd timer unit files.
- js2 3y agosystemd is is many things, but obvious and accessible is not one of them. It has a lot of power and flexibility, but the trade off is a lot of complexity. Just look at the unit configuration file: https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html https://www.freedesktop.org/software/systemd/man/latest/syst... I've never heard of a systemd timer before, but I guessed it was a type of unit file, so I just read the documentation: https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html https://www.freedesktop.org/software/systemd/man/latest/syst... I have no idea from that documentation how I'd run something every hour. I guess I have to create a new unit file, and use the OnCalendar stanza? But what do I set it to? I'm directed to this page: https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html https://www.freedesktop.org/software/systemd/man/latest/syst... Oh, I see I can use "hourly" but it turns out that's syntactic sugar for: *-*-* *:00:00 Is that really any easier than the cron equivalent? 0 * * * * Which can also be written (on FreeBSD) as: @hourly https://man.freebsd.org/cgi/man.cgi?query=crontab&sektion=5&apropos=0&manpath=FreeBSD+14.0-RELEASE+and+Ports https://man.freebsd.org/cgi/man.cgi?query=crontab&sektion=5&... I started my career as a Unix SA over 25 years ago and have worked with a lot of different Unix-flavored operating systems: SunOS/Solaris, HP/UX, FreeBSD, Linux (Slackware, RedHat, Debian), macOS/OS X, AIX. I'm familiar with all their different variations of init. All of them are esoteric in one way or another. Some of them have their behavior right out in the open where it's easy to see (inittab and rc scripts). Others hide away massive complexity (launchd and systemd) and require extensive documentation to understand. I appreciate all the power that systemd provides. It gets a lot of things right. But in terms of complexity, it's almost an operating system unto itself.
- yau8edq12i 3y agoI'm not quite sure why you felt pressed to write this long-winded response to something I didn't write. I never said that systemd is easy. I said that if someone is running *BSD, today, in 2024, they'll cope with cron's syntax. I'll still reply to one part: > Oh, I see I can use "hourly" but it turns out that's syntactic sugar for: > *-*-* *:00:00 >Is that really any easier than the cron equivalent? > 0 * * * * ...Yes? Ask someone who's not familiar either with cron or systemd to guess what each one mean, with the context that it's supposed to be something related to dates and times. If you're vaguely familiar with how dates are usually written down, and that a star is a wildcard, you can immediately guess that the first one means "any year, any month, any day, any hour, at the first minute, first second". The cron one? It's anyone's guess.