1834443 Members
2472 Online
110067 Solutions
New Discussion

Re: cron - query

 
SOLVED
Go to solution
Sanjiv Sharma_1
Honored Contributor

cron - query

Hi All,

System : N4000/HP-UX 11.00/TZ=SST-8

I have a user "abc" which has the TZ=EST-10EDT. EST-10EDT is 3 hours ahead of SST-8.

abc has a scheduled cronjob at 2:00 am. It is observed that it runs at 2:00am on TZ SST-8 but not TZ EST-10EDT.

Does this mean that the cron for abc doesn't read the profile of abc but it executes the cronjob on the global Timezone "SST-8"?

How do I make the cronjob read the profile of abc and excutes the cronjob at the TZ EST-10EDT?

Thank you,
Everything is possible
4 REPLIES 4
Stephen Keane
Honored Contributor

Re: cron - query

> Does this mean that the cron for abc doesn't read the profile of abc but it executes the cronjob on the global Timezone "SST-8"?

It reads the profile for environment variables etc, but runs on the global timezone, otherwise you'd have to have several instances of cron for each timezone users decide to use.

Sanjiv Sharma_1
Honored Contributor

Re: cron - query

It does read the profile but still execute the cronjob at the global TZ.

I have found the following link in this ITRC forum. Any solution to this issue? My problem seems to be same as mine.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=9375
Everything is possible
Thayanidhi
Honored Contributor

Re: cron - query

The cron scheduler may be refering to only system time. Not the user time zone. when cron reads profile (TZ=???), I don't it has any effect. Cron cannot read user profiles TZ before it starts a job for that user. It dosn't look logical. You may schedule everything according to system's TZ.

Regds
TT
Attitude (not aptitude) determines altitude.
Patrick Wallek
Honored Contributor
Solution

Re: cron - query

Actually cron does NOT read any user profiles (/etc/profile, ~/.profile, etc.) at all. cron does not work that way. The line specified in the crontab file will merely be invoked as the user whose crontab it is.

cron jobs will run at the appropriate time with the default timezone as specified in /etc/TIMEZONE.