OT: cron help

g geleem at bellsouth.net
Fri Dec 13 16:27:48 UTC 2013

hello again mike,

On 12/12/2013 10:35 PM, g wrote:
> i do not know what op's
>     0,1
> would do as i have never seen <,> used in any cron commands.

now i do. and when i found it, it did come back to me, in spite
of my 'chemo brain'. ;=)

while watching reruns of 'space 1999', during a commercial,
the use of <,> key hit me and i did recall it from a very long time
ago, so i decided to run a search.

which was;

   About 307,925 results

i found;



0,15,30,45 * * * * /usr/bin/foo

Will run /usr/bin/foo every 15 minutes on every hour, day-of-month,
month, and day-of-week. In other words, it will run every 15 minutes
for as long as the machine it running.


How do I run a task every 5 minutes?

One option is to use

MAILTO=cron at username.plus.com
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /command/to/execute

However, there is a special shortcut for this:
MAILTO=cron at username.plus.com
*/5 * * * * /command/to/execute

The */5 is known as a short form equivalent to 0,5,10,15,20 etc...
and achieves the same effect as the previous example, executing the
command every 5 minutes. Other examples are: */2 would be every 2 mins,
*/30 every 30 minutes and so on. You can use the same short form for
the hour indicator */2 every 2 hours, */6 every 6 hours etc.


If you want the cron job to run at 1:00 and 2:00 A.M:

* 1,2 * * * /home/username/public_html/mail.sh

This runs your cron at 1A.M and 2A.M every day, every month and every week.


i hope that helps you more with your cron.



peace out.

in a world with out fences, who needs gates.



More information about the users mailing list