<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: crontab - wrong time zone in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482527#M847553</link>
    <description>I bounced the machine after making sure the TIMEZONE file was correct and I believe it was ...&lt;BR /&gt;&lt;BR /&gt;TZ=PST8PDT&lt;BR /&gt;export TZ&lt;BR /&gt;&lt;BR /&gt;I still get the same results, I am stumped for now.&lt;BR /&gt;</description>
    <pubDate>Thu, 10 Feb 2005 20:46:50 GMT</pubDate>
    <dc:creator>Stephen Badgett</dc:creator>
    <dc:date>2005-02-10T20:46:50Z</dc:date>
    <item>
      <title>crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482520#M847546</link>
      <description>How do I get crontab to use our TZ correctly  without manually calculating a 3 hour time difference?&lt;BR /&gt;----------------------------------------------&lt;BR /&gt;I have a simple test crontab job &lt;BR /&gt;&lt;BR /&gt;2 16 * * 2,3,4,5,6 ll &amp;gt;/tmp/TIMEZONE.log&lt;BR /&gt;&lt;BR /&gt;This is to run @ 4:02 pm as shown here but, the crontab job here ran Wed Feb  9 13:02:02 PST 2005&lt;BR /&gt;&lt;BR /&gt; ll TIMEZONE.log |cut -b 35-&lt;BR /&gt;      7429 Feb  9 13:02 TIMEZONE.log&lt;BR /&gt;&lt;BR /&gt;echo $TZ&lt;BR /&gt;PST8PDT&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 16:33:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482520#M847546</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-09T16:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482521#M847547</link>
      <description>My cron respects the timezone, so I could only guess that Your timezone is not set in /etc/TZ but defined somewhere else.&lt;BR /&gt;&lt;BR /&gt;Check what's inside /etc/timezone, if that's ok I don't know where else to look.</description>
      <pubDate>Wed, 09 Feb 2005 16:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482521#M847547</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-02-09T16:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482522#M847548</link>
      <description>I suspect what has happened is that /etc/TIMEZONE was edited after the cron daemon started.&lt;BR /&gt;&lt;BR /&gt;cd /sbin/init.d&lt;BR /&gt;./cron stop&lt;BR /&gt;&lt;BR /&gt;./cron start&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 16:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482522#M847548</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-09T16:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482523#M847549</link>
      <description>cat /etc/TIMEZONE&lt;BR /&gt;TZ=PST8PDT&lt;BR /&gt;export TZ&lt;BR /&gt;&lt;BR /&gt;and I have noticed a /etc/default/tz&lt;BR /&gt;&lt;BR /&gt;cat /etc/default/tz&lt;BR /&gt;EST5EDT&lt;BR /&gt;&lt;BR /&gt;would this have an affect?&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 16:59:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482523#M847549</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-09T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482524#M847550</link>
      <description>I will try a cron stop and start.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 17:01:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482524#M847550</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-09T17:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482525#M847551</link>
      <description>I did a stop/start of cron and the affect is still the same.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 17:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482525#M847551</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-09T17:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482526#M847552</link>
      <description>The answer is still the same but there is a gotcha. All of the scripts under /sbin/init.d are run by rc and rc is responsible for reading  /etc/TIMEZONE. If that value is not found, it defaults to the timezone value defined in the kernel. Man 4 rc.config for details. &lt;BR /&gt;&lt;BR /&gt;This procedure should work: Make sure that TZ is set and exported as the current user, root. Now bounce the cron daemon. The bad news is that cron should really never exit so cron shouldn't really be bounced; the really "correct" procedure is to reboot after making certain that /etc/TIMEZONE is valid.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2005 18:38:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482526#M847552</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-09T18:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482527#M847553</link>
      <description>I bounced the machine after making sure the TIMEZONE file was correct and I believe it was ...&lt;BR /&gt;&lt;BR /&gt;TZ=PST8PDT&lt;BR /&gt;export TZ&lt;BR /&gt;&lt;BR /&gt;I still get the same results, I am stumped for now.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Feb 2005 20:46:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482527#M847553</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-10T20:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482528#M847554</link>
      <description>This one is very strange. I would look for and apply the latest cumulative cron and rc patches. One thing that might have happened is that someone "improved" the rc.config or rc script so that /etc/TIMEZONE is not actually sourced. I would also be interested to know what the kernel's timezone tunable is set to. I'm betting it's set to 300 and that value is what is winning but /etc/TIMEZONE should override it.</description>
      <pubDate>Thu, 10 Feb 2005 21:49:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482528#M847554</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-10T21:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482529#M847555</link>
      <description>Had a similar problem once on a Linux box, and it turned out there was a bogus time zone file someplace and just happened to be on the PATH before the real one.&lt;BR /&gt;&lt;BR /&gt;However - the entire server's time was off not just cron.&lt;BR /&gt;&lt;BR /&gt;Not sure if this applies to your situation.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2005 12:48:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482529#M847555</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2005-02-11T12:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482530#M847556</link>
      <description>Thank you for your help.&lt;BR /&gt;&lt;BR /&gt;The tunable for timezone is 420&lt;BR /&gt;&lt;BR /&gt;I looked through the rc script and found the TZ=EST5EDT -- I will change it there and see if that makes a differance.&lt;BR /&gt;&lt;BR /&gt;I will also look at the path and see if there is something that might be changing it.</description>
      <pubDate>Fri, 11 Feb 2005 13:25:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482530#M847556</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-11T13:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482531#M847557</link>
      <description>The "TZ=EST5EDT" line is /sbin/rc is there to set a default value in case /etc/rc.config or /etc/TIMEZONE are not found; if changing this line changes the behavior of cron then you have narrowed the problem but it does not explain why cron uses it when you explicitly execute /sbin/init.d/cron start after setting and exporting TZ. Something that would explain all of this is if someone has improved the "/sbin/init.d/cron" script itself and defined TZ inside it. Since it's possible that someone has improved things for you, I would also make sure that the symbolic links in /sbin/rc1.d and /sbin/rc2.d point to the cron script in /sbin/init.d. &lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2005 18:10:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482531#M847557</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-11T18:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482532#M847558</link>
      <description>I looked through the /sbin/init.d/cron script - rather short - and found no TZ information in it and compared the file on a different machine they just a like too. &lt;BR /&gt;&lt;BR /&gt;The Symbolic links are there too...&lt;BR /&gt;&lt;BR /&gt;sbadgett:HAL: /sbin/rc1.d&amp;gt; ll -u |grep cron&lt;BR /&gt;lrwxr-xr-x   1 root       root            17 Feb 11 16:23 K270cron -&amp;gt; /sbin/init.d/cron&lt;BR /&gt;sbadgett:HAL: /sbin/rc1.d&amp;gt; ll -u /sbin/rc2.d |grep cron&lt;BR /&gt;lrwxr-xr-x   1 root       root            17 Feb 11 16:24 S730cron -&amp;gt; /sbin/init.d/cron&lt;BR /&gt;s&lt;BR /&gt;&lt;BR /&gt;We are going to boot the machine again after running "set_parms timezone" and I am not sure this will help since the TIMEZONE file was already set correctly.</description>
      <pubDate>Fri, 11 Feb 2005 19:38:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482532#M847558</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-11T19:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482533#M847559</link>
      <description>Just because you didn't find any TZ's in /sbin/init.d/cron doesn't mean they aren't there. You also need to look for any "." (dot) operators which would source other files. For example, this script sources /etc/rc.config.d/cron via "." and someone mighr have "improved" this file beyond its normal role of simply deciding whether or not cron shpould execute. One other crazy thought is have you done "a ps -ef | grep cron" to see if only one cron daemon is running?</description>
      <pubDate>Mon, 14 Feb 2005 12:28:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482533#M847559</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-14T12:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482534#M847560</link>
      <description>I have gone through the /sbin/init.d/cron file and looked for any sourcing and only found the /etc/rc.config.d/cron that allows cron to be loaded.  CRON=1&lt;BR /&gt;&lt;BR /&gt;I also do a ps -ef |grep -i cron and oly found the one /usr/sbin/cron running.</description>
      <pubDate>Mon, 14 Feb 2005 17:02:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482534#M847560</guid>
      <dc:creator>Stephen Badgett</dc:creator>
      <dc:date>2005-02-14T17:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482535#M847561</link>
      <description>I'm about out of ideas. Again look from cron patches and check /usr/lib/tztab. Cron accesses this file and it's just possible a bogus entry in this file is the culprit. I would also launch a script under cron and have it output the date command. This would tell you what TZ thinks it is --- although off the top of my head, I don't think TZ is exported to the cron'ed process.</description>
      <pubDate>Mon, 14 Feb 2005 20:30:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482535#M847561</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-14T20:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - wrong time zone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482536#M847562</link>
      <description>You may need to instrument the rc scripts that start prior to cron. Use logger to put the state of TZ into syslog (rc scripts are run differently than a login). Put a line like this at the start of each script preceeding cron:&lt;BR /&gt; &lt;BR /&gt;logger -t "$0" -p local1.info "TZ=$TZ"&lt;BR /&gt; &lt;BR /&gt;Now in syslog (after reboot), you can see where TZ changes value.</description>
      <pubDate>Mon, 14 Feb 2005 22:25:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-wrong-time-zone/m-p/3482536#M847562</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-02-14T22:25:11Z</dc:date>
    </item>
  </channel>
</rss>

