Subject: Re: date in cron emails
To: None <netbsd-users@NetBSD.org>
From: George Georgalis <george@galis.org>
List: netbsd-users
Date: 03/02/2007 17:17:14
On Fri, Mar 02, 2007 at 04:51:37PM -0500, Steven M. Bellovin wrote:
>On Fri, 2 Mar 2007 13:45:37 -0500
>"George Georgalis" <george@galis.org> wrote:
>
>> On Fri, Mar 02, 2007 at 01:27:42PM -0500, Chuck Swiger wrote:
>> >On Mar 2, 2007, at 1:21 PM, George Georgalis wrote:
>> >>I'd like the local date on emails sent by cron
>> >>(vs GMT).  Is there an env I can set or another
>> >>straightforward solution?
>> >
>> >What happens if you set the TZ environment variable in the cron job?
>> 
>> #TZ=America/New_York
>> #TZ=EST
>> TZ=-500
>> 
>That's inside the script you invoke via cron, or perhaps in the crontab
>itself?  I wouldn't expect those to work, since they wouldn't affect
>cron's environment.
>
>What is /etc/localtime?  If that's set properly, it should apply to all
>programs, not just cron.  If you want a time zone setting for all cron
>jobs but not the whole system, I think you can put something like
>
>	TZ=EST5EDT; export TZ
>
>in /etc/rc.conf.d/cron

my /etc/localtime is set, same as how I want the emails... and
using TZ in /etc/rc.conf.d/cron didn't help.

I'm using /usr/sbin/mailwrapper and /etc/mailer.conf to run
/var/qmail/bin/sendmail; but it's not clear to me where time gets
added to mail messages, eg because my mail client for example also
uses that binary, with and gets the local date.

I know in the qmail archives somewhere there is a reason
qmail-inject adds GMT time vs localtime to messages that don't
have a Date: header.  But if typical netbsd sendmail users have
localtime in their cron emails, the qmail sendmail wrapper should
too... oh well.

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><