cron every thirty minutes from 13:00 to 17:00 seems easy, but the obvious entry also runs it at 17:30
16
votes
1
answer
2848
views
cronie 1.5.2 on RHEL 8.10
This entry runs foobar every 30 minutes from 13:00 to 17:30.
*/30 13-17 * * 1-5 foobar.sh
Is there some clever (but not hackish, like adding "exit if it's 17:30" to the script) way to get it to not run at 17:30, or is brute force (two crontab entries) the best way?
*/30 13-16 * * 1-5 foobar.sh
0 17 * * 1-5 foobar.sh
Asked by RonJohn
(1421 rep)
Jun 1, 2025, 08:32 PM
Last activity: Jun 2, 2025, 05:05 PM
Last activity: Jun 2, 2025, 05:05 PM