Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron timing differs from system time

Status
Not open for further replies.

xenomage

Programmer
Jun 27, 2001
98
SG
Hi All,

i have a problem with the cronjob on solaris 8.

Say for example, i set a cronjob to do the following.

"0-59 * * * * echo`date` > cron_time.txt"

At the same time, i would check the system date by using the "date" command.

it turns out that the cronjob time is on local time and system time is on UTC.

Does anyone knows how to solve this such that the cronjob time will also use UTC?

Any help will be appreciated.

Many Thanks.
xeno
 
can I see the output of
Code:
# egrep "^TZ" /etc/TIMEZONE

does this Timezone differ from your shell environment's Timezone?

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
it's different.

> grep "^TZ" /etc/TIMEZONE
TZ=Singapore


That's the problem. The cronjob uses SGT but system uses UTC. Don't understand how it can be changed.
 
Just edit it in /etc/TIMEZONE and set it to what you want. This will set the time on the next reboot. I think you can also export TZ=whatever from the command line.
 
>> TZ=Singapore
somebody was dreaming of his/her next vacation... ;-)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top