1841306 Members
3275 Online
110179 Solutions
New Discussion

CRON issue

 

CRON issue

Hi,

ON HP-UX 11.31.

With this line in crontab file (and crontab -l),
30 06 2,8,15,22,29 * * sh prog.sh,

the program prog.sh started on March 1 at 06h30.

Why?

I suggest there is a bug and that March 1 is considered as Feb 29.
But there is no FEB 29 in 2010.

I suggest also that the bug exists when the command "crontab crontabfile" is executed before FEB 28 because I can't reproduce the anomaly with tests on March 1.

Please, you advise.
JMW
7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: CRON issue

>the program prog.sh started on March 1 at 06h30.

I don't see why. It should be March 2 at that time of the morning. Did it just happen 5+ hours ago or was it yesterday?
What timezone setting to you have? TZ?

Re: CRON issue

Hello Dennis,

The anomaly appears yesterday on March 1.
Today, we are March 2.

Yesterday, the date on the system was March 1.
I checked this when the anomaly appears.

# cat /etc/TIMEZONE
TZ=MET-1METDST
export TZ
#

And this is the lines on /var/adm/cron/log
at March 1 around 6h30:

> root 25305 c Mon Mar 1 06:25:00 MET 2010
> CMD: /usr/sbin/dmesg - | tee -a /var/adm/messages | logger -t "dmesg[$$]" -p
user.warning
> root 25306 c Mon Mar 1 06:25:00 MET 2010
< root 25306 c Mon Mar 1 06:25:00 MET 2010
< root 25305 c Mon Mar 1 06:26:43 MET 2010
> CMD: /usr/local/bin/restartDB CC
> root 26165 c Mon Mar 1 06:30:00 MET 2010
> CMD: sh prog.sh
> root 26166 c Mon Mar 1 06:30:00 MET 2010
< root 26166 c Mon Mar 1 06:31:52 MET 2010
< root 26165 c Mon Mar 1 06:31:53 MET 2010
> CMD: /usr/sbin/dmesg - | tee -a /var/adm/messages | logger -t "dmesg[$$]" -p
user.warning
> root 27398 c Mon Mar 1 06:35:00 MET 2010
< root 27398 c Mon Mar 1 06:35:00 MET 2010

JMW

Re: CRON issue

Hello dennis, and all,

I checked the environment and configuration with a colleague, because it seems unbelieval.

I want to know if another user encountered the same anomaly and if another user didn't encountered the anomaly on March 1 with a similar line in the crontab file.

First of all, please confirm my opinion!
According the definition of the cron,
a line like this in the crontab file should not execute the command on MARCH 1:
30 06 2,8,15,22,29 * * sh prog.sh.

JMW



Horia Chirculescu
Honored Contributor

Re: CRON issue

Why don't you re-create the conditions since February, 28 and try to see how crontab is dealing with the same situation?

Horia.
Best regards from Romania,
Horia.

Re: CRON issue

Horia,

No computer available for testing.
Before further investigation, I want to receive advices of the readers of this forum.

JMW


Horia Chirculescu
Honored Contributor

Re: CRON issue

I was unable to re-create your scenario, but I only have tested on the current available hardware running HP-UX 11.11 and 11.00.

Horia.
Best regards from Romania,
Horia.
Dennis Handly
Acclaimed Contributor

Re: CRON issue

>And this is the lines on /var/adm/cron/log at March 1 around 6h30:
> CMD: sh prog.sh
> root 26166 c Mon Mar 1 06:30:00 MET 2010
< root 26166 c Mon Mar 1 06:31:52 MET 2010

It sure seems like it.

>I want to know if another user encountered the same anomaly

Probably too many factors for anyone but you. :-)

>According the definition of the cron, a line like this in the crontab file should not execute the command on MARCH 1:
30 06 2,8,15,22,29 * *

That's correct. You should make sure you have any cron patches PHCO_39042 and if you do, contact the Response Center.