Cronjob to run every 30 minutes

cron

I want to set a cronjob entry that runs a script every 30 minutes from 9:00 to 18:00 but I do not want it to run at 18:30. The script should run for the first time at 9:00 and for the last time at 18:00. Is this possible?

Best Answer

0,30 9-18 * * * /path_to_script

However, the above will run at 18:30. So, you're best bet is to have a separate job to handle 18:00. So:

0,30 9-17 * * * /path_to_script
0 18 * * * /path_to_script

Also, Cron job generators are awesome.

Related Question