Re: [SLUG] Crontab time

2001-11-27 Thread chesty

On Wed, Nov 28, 2001 at 11:39:49AM +1100, George Vieira wrote:
> No time sync.. which I had a time server accurate enough on the web.

cron oddities have come up a few times recently, and for some
reason they tweak my interest. I wish they didn't.

I fcsk up a bit up, I want to understand this more so I did a
bit more research.

It doesn't sleep for longer than 60 seconds. It wakes up to check
if the timestamp on /etc/contrab, etc, has changed. I new this, duh.

>From what I can tell, if the clock changes, cron should sort itself 
out the next time it wakes up, which is 1 minute or less.

So even if you did change the time, I have no idea why your job ran 
early unless the time changed in the same minute as the job.

Unless your cron works differently...



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



RE: [SLUG] Crontab time

2001-11-27 Thread George Vieira

No time sync.. which I had a time server accurate enough on the web.

I have just finished modifying the damn script and crontabe to do the
following now...


30 5 * * * * root /usr/../../../helpdesk off "5:30 PM"

etc...etc.. so as long as it runs it'll work just a pain though.

thanks,
George Vieira
Systems Manager
Citadel Computer Systems P/L


-Original Message-
From: chesty [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 10:53 AM
To: Sydney Linux Users Group (E-mail)
Subject: Re: [SLUG] Crontab time


On Wed, Nov 28, 2001 at 09:14:04AM +1100, George Vieira wrote:
> 
> How can this run the minute before instead of ON TIME?

cron works out when the next job is to be run, and sleeps.
So if you change the system time, cron won't notice until
after it wakes up. If the time change is minor, it just runs the
job. It does different things depending on how big the time
change was, which direction the time change was, and the
type of crontab entry, it handle wild card entries differently.

In your case, it might have worked out that the next job is
to be run in 1000 seconds, so it sleeps for 1000 seconds.
If you then set the time forward 3 seconds, effectively, cron
wakes up 3 seconds early and runs the job in previous minute.

Do you sync the clock with ntp or some other way?

chesty


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Crontab time

2001-11-27 Thread chesty

On Wed, Nov 28, 2001 at 09:14:04AM +1100, George Vieira wrote:
> 
> How can this run the minute before instead of ON TIME?

cron works out when the next job is to be run, and sleeps.
So if you change the system time, cron won't notice until
after it wakes up. If the time change is minor, it just runs the
job. It does different things depending on how big the time
change was, which direction the time change was, and the
type of crontab entry, it handle wild card entries differently.

In your case, it might have worked out that the next job is
to be run in 1000 seconds, so it sleeps for 1000 seconds.
If you then set the time forward 3 seconds, effectively, cron
wakes up 3 seconds early and runs the job in previous minute.

Do you sync the clock with ntp or some other way?

chesty


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



[SLUG] Crontab time

2001-11-27 Thread George Vieira



Hi 
all,
 
I have a very weird 
problem which doesn't make sense to me. Here is my crontab below which 
runs at 8:50AM
50 08 * * 1-5 root 
bash -x /usr/local/admin/bin/helpdesk off >/tmp/help.check 
2>&1
 
Now my scripts first 
line grabs the date/time and puts it into a variable... (as 
below)
RUNTIME="`date +\"%d 
%B %Y %H:%M %p\"`"
 
I echoed the 
debug output to the "/tmp/help.check" file and this is what I 
got!
 
++ date +%d %B %Y 
%H:%M %p+ RUNTIME=28 November 2001 08:49 AM
How can this run the 
minute before instead of ON TIME?
My problem is that 
this script checks the crontab running time against a DB file which has 8:50AM 
in it and doesn't match..
 
I can easily pass a 
parameter to say that it's an 8:50 run time even if it runs at 8:48 ot 8:49 yet 
the $1 parameter says 8:50 but that's a suck way to do 
it
 
does crontab do this 
usually?
 
thanks, George 
Vieira Systems Manager Citadel Computer Systems P/L