Click to See Complete Forum and Search --> : setting crontab job -Redhat7.2


enterume
08-30-2002, 05:25 AM
In the crontab job, how can i set run a crontab run on every friday, saturday, and sunday, between 1pm to 8pm , every 2 minute?

Is this the correct way?

0,2,4,6,8...58 13-21 * * 5-7 $HOME/bin/ >2>&1

?


Thanks
LOuis

gigowiz
08-30-2002, 06:18 PM
Originally posted by enterume

0,2,4,6,8...58 13-21 * * 5-7 $HOME/bin/ >2>&1


The execution time designation looks good except for the weekdays. They are numebred 0-6 so you want "4-6" instead of "5-7". And I hope the ellipses means you're going to continue the comma delimited numbers for the minutes. That'll certainly make a long entry.


Hank

gigowiz
08-30-2002, 06:20 PM
OOPS!!!

I mean you want "0,5,6" for the weekdays. Sunday is 0, Monday is 1, etc.

Sorry.

Hank

jstarkey
08-30-2002, 09:50 PM
You can also use:

*/2

rather than:

0,2,4,6,8...58

in the minutes field to tell it to run every 2 minutes. Looks much cleaner that way :)