This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CRON and time


On Tue, Jul 10, 2001 at 12:55:20PM +0200, Michael Schaap wrote:
> However, one thing is funny.  My test crontab had a command like "date >> 
> /tmp/hello.txt", and that behaves slightly different with this version of cron.
> When I run date from the cron-3.0.1-2 version, or when I run date from the 
> command line, I get output like:
>          Tue Jul 10 12:49:29  2001
> But when I run it with this freshly compiled cron, I get:
>          Tue Jul 10 12:49:00 T-1 2001
> I guess both are incorrect, from a UNIX point of view, and the second one 
> is actually a bit better than the first one...

That's very likely related to your TZ setting. Since cron is running
under LocalSystem account it gets only the system default environment
without any user specific addition, even after switching the user
context which only modifies the environment slightly. The difference
is that the old cron had practically no environment except what it
sets by itself.

Try a command "* * * * * env > /tmp/foo" to see the environment you get.

If the date output is somehow vital for you, just set TZ in either the
system environment (which requires a reboot *sob*) or - preferred IMO -
set TZ in your crontab file.

Thanks for your test, I will upload the -4 version now to sourceware.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]