I am trying to setup a cron job on a Ubuntu server. We want the cron job to run the script at certain times of the day and on some specific days of the week. For example, we
You state 2pm in your requirement, hour range should end at 14 instead of 18 (which is 6pm).
*/2 9-14 * * 1-5 /path_to_script
man crontab
http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5
In fact the last hour you want the script to run is 13:00 to 13:59, so you want:
*/2 9-13 * * 1-5 /path_to_script
meaning the first runtime will be 9:00, then 9:02, and so on until 13:58 which will be the last run as 14:00 is not included.
Same as you did for hours:
*/2 09-18 * * 1-5 /path_to_script
0
and 7
stand for Sunday
6
stands for Saturday
so, 1-5
means from Monday to Friday