1844411 Members
2494 Online
110233 Solutions
New Discussion

crontab

 
Fernando Jose P de Souz
Regular Advisor

crontab

Hi,

I have a problem with my crontab.
An oracle user talk to me and said the crontab execute an wrong time.

Is it possible???

O.S.: Hp-ux 11.23 (RX-2600 - Server)

The crontab:
00 01 15 04 5 /hmlgcontrole/AtualizaBases/Simulado/ImpUserSim

The /var/adm/cron/log
> CMD: /hmlgcontrole/AtualizaBases/Simulado/ImpUserSim
> oracle 10648 c Fri Apr 22 01:00:00 SAT 2005

7 REPLIES 7
Rick Garland
Honored Contributor

Re: crontab

min hr monthday month weekday

(I believe this is correct)

So, 0100 hrs, 15th day of the Month of April on Friday.

This won't happen again for 7 years...
Geoff Wild
Honored Contributor

Re: crontab

m h day month week

time is wrong - can't have month/week/day all set....

Try

00 01 15 04 *

etc...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: crontab

Sure its possible.

Check the system time.

this link will help you make sure you are okay

http://www2.itrc.hp.com/service/james/dispDoc.do?docURL=http%3A%2F%2Fdocs.hp.com%2Fen%2FB2355-60105%2Fcron.1M.html&aid=SEARCH_MANUAL&pil=4&serStr=crontab

the code should execute at 1 a.m.

I think the leading zeros are superfluous but should not mess anything up.

If your clock is drifting, consider installing and using ntp

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: crontab

Have a look at the crontab man page.

You syntax does **NOT** mean only on Friday April 15 at 1:00 AM.

What you have will run at 1:00 AM on April 15 AND ALSO EVERY FRIDAY.

Kent Ostby
Honored Contributor

Re: crontab

From the man page:

Note that the
specification of days can be made in two fields: monthday and weekday.
If both are specified in an entry, they are cumulative. For example,

0 0 1,15 * 1 command

runs command at midnight on the first and fifteenth of each month, as
well as every Monday. To specify days in only one field, set the
other field to asterisk (*). For example,

0 0 * * 1 command

runs command only on Mondays.


Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Suraj Singh_1
Trusted Contributor

Re: crontab

I do not see anything wrong in the log file above. The script executed at 0100 hrs on 22nd April 2005, which is FRIDAY.

Since the crontab file implies that the script should be run at 0100 hrs on 15th of April and every FRIDAY, so there is nothing wrong.

~suraj
What we cannot speak about we must pass over in silence.
Himanshu_3
Valued Contributor

Re: crontab

Hi Fernando,

I have recently faced a smiliar kind of issue, where the first part of the script was aborted due to tape drive problem and this lead to the second part to be executed early as compared to the previous times when the script used to run properly.To the endusers, in a whole it gives the impression that the script has run on wrong time.

Cheers,
Himanshu