Reputation:
I need my crontab to execute every 2 hours starting at 10am and the last one running at 10pm.
I currently have
0 */2 * * * /directory/job.sh
How do I block out the hours I don't want?
Thanks!
Upvotes: 21
Views: 32386
Reputation: 1070
0 10/2 * * * /directory/job.sh
would do it.
0 10-22/2 * * * /directory/job.sh
would do it and be more explicit.
0 10,12,14,16,18,20,22 * * * /directory/job.sh
would do it, too.
Upvotes: 41