How can I set a cron to run every 2 hours between 8 am and 5 pm for example? Is this possible?
22 Answers
Actually, Alex's (former) solution will run every minute, every 2 hours between 8 am and 3pm. The right solution is:
0 8-17/2 * * * /path/commandOr even:
0 8,10,12,14,16 * * * /path/commandWhich of course looks less nice, but still does what requested...
20 8-17/2 * * * your_command.sh