> On Mon, 8 Jan 2007, Darren Dunham wrote: > > >> Also notice that unless the TZ variable is set in the > one-liner containing > >> the call to start Nagios it may have no effect whatsoever. > >> > >> $ TZ=America/Anchorage date > >> Sat Jan 6 00:21:33 AKST 2007 > >> > >> $ TZ=America/Anchorage > >> $ date > >> Sat Jan 6 10:27:35 CET 2007 > > > > All the one above does is set a shell variable. Just like any other > > environment variable you really need to make sure it's > exported before > > trying to use it. > > > > $ TZ=America/Anchorage > > $ date # TZ not exported yet > > Mon Jan 8 07:48:52 PST 2007 > > $ export TZ # Now it's visible in the environment > > $ date > > Mon Jan 8 06:48:57 AKST 2007 > > I know that. But exporting a variable means it will be there for any > follow-up command as well. And there are some cases where > that is not what > one wants. > > Hugo.
I'm jumping into this a little late, so pardon if this has been mentioned already. It may be easier to set the timezone for the entire OS rather than just individual environments. In Redhat-based systems, the system timezone file is called "/etc/localtime". This file is either a symlink or a copy of the proper timezone file, located in "/usr/share/zoneinfo/". To set "Ancorage time" as the local system time globally, do this: # cp /usr/share/zoneinfo/America/Anchorage /etc/localtime Other distributions follow similar convention, though file locations may vary slightly. -Tedman ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Nagios-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
