5 Comments

November 20th, 2008 @6:41 pm  

Thank you for the quick and easy post. I haven’t used cron in forever and I’m not too interested in learning it all again either. I needed to run something for a client every 5 minutes and needless to say this post was quite helpful!

mygif
george_glass Said,
November 30th, 2008 @8:13 am  

great! much better than reading stupid man pages.

mygif
sTiVo Said,
October 17th, 2009 @1:06 pm  

This may be much simpler “than reading stupid man pages” but it’s WRONG!!!!!

It will run the cron job at five minutes after every hour.

You want something like:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * echo ‘Hello’

mygif
GDawg Said,
November 20th, 2009 @10:39 am  

Actually, according to “the stupid man pages”, */5 will cause it to run every 5 minutes. ;-)

from cron(5)

Step values can be used in conjunction with ranges. Following a range
with “” specifies skips of the number’s value through the
range. For example, “0-23/2″ can be used in the hours field to specify
command execution every other hour (the alternative in the V7 standard
is “0,2,4,6,8,10,12,14,16,18,20,22″). Steps are also permitted after
an asterisk, so if you want to say “every two hours”, just use “*/2″.

mygif
akhilpsg Said,
February 14th, 2010 @10:00 pm  

.—————- minute (0 – 59)
| .————- hour (0 – 23)
| | .———- day of month (1 – 31)
| | | .——- month (1 – 12) OR jan,feb,mar,apr …
| | | | .—- day of week (0 – 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * command to be executed

This will give still more detailed info for cron.

mygif

Random Post

Leave Your Comments Below

Please Note: All comments will be hand modified by our authors so any unsuitable comments will be removed and you comments will be appreared after approved