|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Solaris 9 Zone : Date command in crontab shows delayed(One Hour) output
SOLARIS 9 Zone :
date command in crontab shows delayed(One Hour) output Hi folks, the date command shows the correct date and time, How ever, if the date command executed through crontab in any form of scrip the output shows as one hour delayed, similar to date -u.. Can some one help in this.. ++++++++++++++++++++++++++++++++++++++++++ Date command perfectly shows judi:root:/tmp# date Fri Feb 15 15:08:03 MET 2013 judi:root:/tmp# The script used to get the output to test.out judi:root:/tmp# more test.sh #!/usr/bin/ksh DT=`date '+%y%m%d-%H:%M'` LOG=/tmp/test.out echo $DT >> $LOG judi:root:/tmp# the cron entry used.. * * * * * /tmp/test.sh output of the script execution (delayed for one hour) judi:root:/tmp# more test.out 130215-14:03 130215-14:04 130215-14:05 130215-14:06 130215-14:07 130215-14:08 judi:root:/tmp# judi:root:/tmp# date Fri Feb 15 15:08:10 MET 2013 judi:root:/tmp#
Last edited by DukeNuke2; 02-15-2013 at 10:32 AM.. Reason: Added Solaris 9 |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Setting the expected timezone in the script called from cron should workaround the issue, eg: Code:
#!/bin/ksh export TZ=Europe/Paris DT=`date '+%y%m%d-%H:%M'` LOG=/tmp/test.out echo $DT >> $LOG Alternatively, set/fix TZ in /etc/default/init and reboot the zone. Last edited by jlliagre; 02-15-2013 at 10:38 AM.. |
| The Following User Says Thank You to jlliagre For This Useful Post: | ||
judi (02-25-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks for your reply jlliagre
the time zone is properly set and even server had a reboot after the time zone settings.. |
|
#4
|
|||
|
|||
|
Did you modify the test.sh script as I suggested ?
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
yes I modified the test.sh, Now the output is perfect, still I am afraid this cannot be advised to all users and application cronjobs right ?
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
The clock is correct, the timezone setting is not for some reason. Please provide more clues/evidences.
|
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Sorry , I dont have any clue and totally confused.. Please be more specific on what else we can check..
Also I did not find any thing interesting (about time settings) in /etc/.profile.. ![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete | citizencro | UNIX for Dummies Questions & Answers | 3 | 04-11-2011 09:03 PM |
| date command issue from crontab | pritish.sas | Shell Programming and Scripting | 1 | 05-28-2010 03:24 AM |
| Crontab for every minute or every hour | kaushik02018 | Shell Programming and Scripting | 1 | 01-15-2010 10:11 AM |
| getting the date in crontab command | pranavagarwal | UNIX for Dummies Questions & Answers | 7 | 12-12-2007 12:09 PM |
|
|