System time and Cron time stamp not matching


 
Thread Tools Search this Thread
Operating Systems Solaris System time and Cron time stamp not matching
# 1  
Old 04-24-2012
System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help

here is what i get when i check for system date
Code:
infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date
Tue Apr 24 15:27:43 GMT 2012

at same time i executed a cron job, and checked time stamp on log generated from cron Job
Code:
infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> ls -l /tcpdv1_ie10/tcadmin/cronlogs/user_login.log
-rw-r--r--   1 infodba  tcgrp        243 Apr 24 10:10 /tcpdv1_ie10/tcadmin/cronlogs/user_login.log

Don't know what's causing this issue

so the system date is "Tue Apr 24 15:27:43" and time stamp on the file created by cron is "Apr 24 10:10"
# 2  
Old 04-24-2012
looks like it's due to timezone configuration.
execute grep TZ ~/.*profile and post what it returns.
# 3  
Old 04-24-2012
Is the script the same one which you were testing in your previous thread? It messes with the TZ variable:
https://www.unix.com/shell-programmin...n-count-2.html

What is you normal timezone?

I suspect that the script running from cron is messing with the timezone.
In case your cron is not set up correctly, please try a one-off script run form cron with output redirected to a file and containing these two commands:

Code:
date
set

Then compare the date of the log file with the output from the date command taking into account the value of $TZ .
# 4  
Old 04-25-2012
Hello sailesh
Code:
grep TZ ~/.*profile

returned empty, i checked my .profile
here is how it looks
Code:
infodba-ie10ux014:/home/infodba\n\r-> cat .profile
#       This is the default standard profile provided to a user.
#       They are expected to edit it to meet their own needs.
#  Raghu added the new PATH /SPLM/tcadmin/bin

export EDITOR=vi
MAIL=/usr/mail/${LOGNAME:?}

. $HOME/.kshrc

PATH=/tcpdv1_ie10/tcadmin/bin:$HOME/bin:/usr/X/bin:$PATH
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin
PATH=$HOME/bin:/usr/X/bin:$PATH
set -o vi
# Disabled until server share is enabled
aview


UGS_LICENSE_SERVER=xxxx@XXXXXXXXX; export UGS_LICENSE_SERVER
# FMS_HOME=/SPLM/Teamcenter83/fcc; export FMS_HOME

Hello Methyl
I executed the cron script as you suggested, from the output this what i get for TZ
Code:
TZ=Asia/Calcutta

when i directly execute the date command from shell i get
Code:
infodba-ie10ux014:/home/infodba\n\r-> date
Wed Apr 25 12:12:16 GMT 2012

Since my Timezone is Asia/Calutta, does teh GMT need to be changed?,

Raghu

---------- Post updated at 04:09 AM ---------- Previous update was at 01:43 AM ----------

i checked my /etc/TIMEZONE
Code:
# be enclosed in double quotes (") or single quotes (').
#
TZ=Asia/Calcutta
CMASK=022
LANG=en_US.UTF-8

# 5  
Old 04-25-2012
The syntax for the value of TZ in /etc/TIMEZONE looks wrong to me.
Anybody with a similar Solaris in that part of the world got a view on this?

Can't see where GMT0BST came from. Is the value being overridden in /etc/profile ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Difference between time stamp

Hi All i have a file data like below format A, B 2016-04-14 16:30:00,2016-04-14 16:31:17 2016-04-14 16:40:00,2016-04-14 16:41:10 2016-04-14 16:50:00,2016-04-14 16:50:41 2016-04-14 17:00:00,2016-04-14 17:00:35 2016-04-14 17:10:00,2016-04-14 17:11:48 2016-04-14 17:20:00,2016-04-14 17:20:37 i... (2 Replies)
Discussion started by: Tarak_nath
2 Replies

2. Shell Programming and Scripting

Time stamp Difference

I have a log file which wrote time stamp like this 2013-02-11 00:46:40.389037 2013-02-12 11:46:40.197045 can any one help me to get the time stamp difference of these two line in seconds. (4 Replies)
Discussion started by: netdbaind
4 Replies

3. Shell Programming and Scripting

file time stamp

Hi All, I am facing small problem. i want to print file time stamp on which date file has placed in the server. i have given some code but its not giving the year. any help appreciated. regards rajesh. (4 Replies)
Discussion started by: rajesh_pola
4 Replies

4. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

5. Shell Programming and Scripting

regarding time stamp

hi everyone i am facing a strange problem here suppose content of my file is a=1,2,3 b=2,3,4 c=4,5,6 time= now the problem is i want to add value in front of time variable and the value should be i format only "HHMMSS" so it should be like this a=1,2,3 b=2,3,4 c=4,5,6... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

6. UNIX for Dummies Questions & Answers

How to get the next time stamp in perl?

Hi, I have to find the next time stamp in perl. Here is the code. @time = loaltime(time); print "\n Present time: $time:$time:$time \n"; For example if the time is: "12:55:02" after some process the time becomes 1:00:00. How do i check when it becomes 00:00 i.e from "12:55:02... (0 Replies)
Discussion started by: vanitham
0 Replies

7. Solaris

getting time independent of system time in solaries

i am using function gethrtime() in sun solaries to get the time independent of the system time.Problem with this function is if we restart the system time will change to '0'.is there any other way to resolve this problem. thanks & regards suresh (3 Replies)
Discussion started by: suresh_rtp
3 Replies

8. Shell Programming and Scripting

System time comparison to fixed defined time

I have a requirement of checking the current system time and performing certain actions in a shell script. example: if the current system time is greater than 1400 hrs, then perform step 1,2,3 if the current system time is greater than 1000 hrs, then perform step 1,2 if the current system time... (2 Replies)
Discussion started by: zainravi
2 Replies

9. Shell Programming and Scripting

greping with time stamp

Hi all, I want to grep a file name with time stamp as 30 minutes how can i??. Ex I will getting outputs in a file every minutes I want to grep it by a time intervals of 30 and show it . Any help will be great ! Thanks, Arun. (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

10. UNIX for Dummies Questions & Answers

capturing the time stamp

Hi All, I am working on a korn shell script. i have a file such as: DS.PETSCO.20060601203514.20060531.ctl_20060717124431 i have 2 problems here. 1) i have to capture the time stamp from the above file i.e this number 20060717124431. format of time stamp is YYYYMMDDHHMMSS. can... (4 Replies)
Discussion started by: pavan_test
4 Replies
Login or Register to Ask a Question

Featured Tech Videos