On Sat, May 23, 2009 at 9:46 PM, GT <catch....@marketmentat.com> wrote:

> Late entry to this thread, but...
>
> I thought I had found an answer to this; at present I think I might have
> been mistaken.
>
> My crontab has about a dozen jobs that need to run in
> TZ=America/New_York, and another dozen that ideally want
> TZ=Australia/Sydney... the server default is America/Chicago.
>
> Given that the DST wobble for Australia/Sydney is not the same as for
> America/New_York (and given that I am lazy) I wanted ONE crontab that
> would serve year-round, rather than FOUR crontabs that had to be swapped
> in and out all the time (even if that could be done by a cron job).
>
> I thought I had found a solution - simply insert a line
>
>    TZ=America/New_York
>
> before the US jobs, and
>
>    TZ=Australia/Sydney
>
> before the Australian ones. A final statement to return TZ to sever
> default would be optional.
>
>
> I checked that TZ changes worked, by adding a cron job (for testing
> purposes) under each TZ declaration, of the form
>
>    TZ=America/New_York
>    * * * * * date >> /home/mysite/public_html/tmp/log.txt 2>&1
>
> and
>
>    TZ=Australia/Sydney
>    * * * * * date >> /home/mysite/public_html/tmp/log.txt 2>&1
>
<SNIP>



I propose the following:
  cron itself has no concept of timezone.  it is 'date' that is picking up
TZ and reporting as such.  Cron's job is so simple is that it wakes up each
minute to see if it has work to do, regardless of timezone, or anything
else.

You might want to try some other determining factor, such as a shell
builtin.


Good luck.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to