4 ms·
I started writing a "oh, I never found it that difficult" comment. Then I thought to test my own belief and tried to type out a cron schedule for "run this ever
by hiAndrewQuinn 3y ago
I started writing a "oh, I never found it that difficult" comment. Then I thought to test my own belief and tried to type out a cron schedule for "run this every hour", and... Well...
https://crontab.guru/#*_0/1_*_*_ https://crontab.guru/#*_0/1_*_*_*
Oops. Point taken :)
- js2 3y agoRun this every hour is: 0 * * * * this Adjust the leading digit to whichever minute of the hour you wish to run this.
- Karellen 3y agoAs well as the already-mentioned `n * * * *` solution, there's also dropping a symlink in /etc/cron.hourly to the program to run. Or a 2-line shell script if you need to add command-line params. (The other line is the shebang.)
- js2 3y agoThe cron.hourly directory is a non-standard Linux concept provided by run-parts. The FreeBSD equivalent is periodic, but that's really for system tasks and doesn't have anything more granular than daily.
- Karellen 3y agoYeah, but the comparison was specifically comparing to systemd timers, so I'm pretty sure the GP wasn't considering non-Linux compatibility anyway.