Is it possible to get a cron job to run between certain hours only?
I'm editing a crontab for a job that I want to run every minute but only between the hours of 10pm and 2am. Outside this time I'd like it to run every 10 minutes, I'm not sure if this is possible though.
Any help appreciated, thanks.
It would probably be best to have it a 2 separate jobs, one for each hourly group
* 22-23,0-2 * * * command
*/10 2-22 * * * command
It's easiest to do in two lines.
* 22-23,0-2 * * * command
*/10 2-22 * * * command
This might be specific syntax for vixie cron, though. Check man 5 crontab