1829390 Members
3366 Online
109991 Solutions
New Discussion

crontab

 
srinivasa rao vaddadi
Frequent Advisor

crontab

my entries in the crontab were like this

5 0 */2 * * /www/app/apache rotate .
is it every 2 week at 00:05 min in a month?

plz confirm me regarding this.
4 REPLIES 4
Adisuria Wangsadinata_1
Honored Contributor

Re: crontab

Hi,

Here is the formula :

# minute hour day_of_month month weekday command
# These fields accept the following values:
# minute 0 through 59
# hour 0 through 23
# day_of_month 1 through 31
# month 1 through 12
# weekday 0 through 6 for Sunday through Saturday

For more details, check the man page :

# man crontab

If you want to be every 2 week :

05 00 * 1,15 * /www/app/apache.rotate

So the command will executed on day 1 and day 15 (consider every 2 weeks).

Hope this information can help.

Cheers,
AW
now working, next not working ... that's unix
srinivasa rao vaddadi
Frequent Advisor

Re: crontab

could u please explain wat is this */2 in the third field indicates
Patrick Wallek
Honored Contributor

Re: crontab

Are you on HP-UX? Or are you running Linux?

If you are running HP-UX the "*/2" means ABSOLUTELY NOTHING! That is an invalid syntax for HP-UX crontab.

If you are running Linux, check the man page ('man crontab').

A. Clay Stephenson
Acclaimed Contributor

Re: crontab

You are the victim of Linux's "improved" crontab. Why they insist on "fixing" things that have been working for decades is beyond my understanding. In this case it means every 2nd (every other) day at 00:05. This syntax is not understood by the standard flavors of UNIX.
If it ain't broke, I can fix that.