Is this the correct way for setting a cron job to run every 3 hours? After setting it this way, cron is executing the command every minute.
Asked
Active
Viewed 1.8e+01k times
63
-
2http://unix.stackexchange.com/? – BenC Mar 19 '14 at 16:31
3 Answers
135
Change Minute to be 0
. That's it :)
Note: you can check your "crons" in http://cronchecker.net/

Aman Aggarwal
- 17,619
- 9
- 53
- 81

jimm-cl
- 5,124
- 2
- 25
- 27
-
how can i set it to start at particular time as well ? for eg; every 3 hours starting from 12 pm. – Sidharth Ramesh Mar 06 '19 at 03:31
42
Change Minute parameter to 0.
You can set the cron for every three hours as:
0 */3 * * * your command here ..

Aman Aggarwal
- 17,619
- 9
- 53
- 81
16
The unix setup should be like the following:
0 */3 * * * sh cron/update_old_citations.sh
good reference for how to set various settings in cron at: http://www.thegeekstuff.com/2011/07/cron-every-5-minutes/

shacharsol
- 2,326
- 20
- 14