How to set a cron job to run every 3 hours [duplicate]
Asked Answered
A

3

66

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.

enter image description here

Antimonous answered 19/3, 2014 at 15:0 Comment(1)
unix.stackexchange.com?Vogue
S
136

Change Minute to be 0. That's it :)

Note: you can check your "crons" in http://cronchecker.net/

Example

Sonni answered 19/3, 2014 at 16:11 Comment(1)
how can i set it to start at particular time as well ? for eg; every 3 hours starting from 12 pm.Promise
S
43

Change Minute parameter to 0.

You can set the cron for every three hours as:

0 */3 * * * your command here ..

Springing answered 25/3, 2015 at 6:25 Comment(0)
A
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/

A answered 25/10, 2015 at 9:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.