File created with wrong timestamp


 
Thread Tools Search this Thread
Operating Systems Solaris File created with wrong timestamp
# 1  
Old 06-29-2015
File created with wrong timestamp

Hi All,

We are working on solaris 10.

I create a file using touch command and when list the file, it does not shows the right timestamp.



Code:
                                                                      
-bash-3.2$ date                                                                  
Mon Jun 29 16:27:06 IST 2015                                                     
-bash-3.2$ touch abc                                                             
-bash-3.2$                                                                       
-bash-3.2$                                                                       
-bash-3.2$ ls -tlr abc                                                           
-rw-r-----   1 ecmsacc  ecmsgroup       0 Jun 29  2015 abc                       
-bash-3.2$ ls -ltre abc                                                          
-rw-r-----   1 ecmsacc  ecmsgroup       0 Jun 29 21:21:16 2015 abc               
-bash-3.2$                                                                       
-bash-3.2$ ls -ltrE abc                                                          
-rw-r-----   1 ecmsacc  ecmsgroup       0 2015-06-29 21:21:16.002139000 +0530 abc
-bash-3.2$                                                                       
-bash-3.2$ uname                                                                 
SunOS                                                                            
-bash-3.2$ uname -a                                                              
SunOS mohecms01 5.10 Generic_150401-09 i86pc i386 i86pc                          
-bash-3.2$                                                                       
-bash-3.2$ cat /etc/TIMEZONE                                                     
TZ=Asia/Calcutta                                                                 
CMASK=022                                                                        
-bash-3.2$                                                                       
-bash-3.2$


Please suggest.

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data

Last edited by vbe; 06-29-2015 at 09:05 AM.. Reason: typo
# 2  
Old 06-29-2015
Where are you when you execute your commands?
On what kind of file system?

Just so we agree on your output, can you type it again but this time I suggest you type:
Code:
date;touch zz;ls -l zz

For it doesnt look like a timezone issue but more like 2 boxes not having the time since one says 27min and the other 21...
# 3  
Old 06-29-2015
Is there an NFS mount involved here? I've seen odd results with those before where the two servers did not agree on the time. It was over 20 years ago and that is probably sorted by now, but I don't have available servers to set up and check.



Robin
# 4  
Old 06-29-2015
Quote:
Originally Posted by rbatte1
Is there an NFS mount involved here? I've seen odd results with those before where the two servers did not agree on the time. It was over 20 years ago and that is probably sorted by now, but I don't have available servers to set up and check.



Robin
Thanks Robin, The issue is coming only on the NFS mounted partition.
Please suggest
# 5  
Old 06-29-2015
The issue isn't that it is NFS mounted (although the problem is made apparent because the file is mounted from a different machine), the issue is that the clock on the server where the file resides is a little bit ahead of the clock on the machine where you are running these commands. You can probably see the clock skew if you run the commands:
Code:
date
touch abc
ls -ltrE abc
date

For a good way to fix the problem run, ntpd on your machine and on all machines that act as file servers for any files you reference from your machine. (See man ntpd for details.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies

2. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

3. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

4. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

5. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

6. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

7. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

8. Homework & Coursework Questions

how to delete core file (file created due to apps crashed)

1. The problem statement, all variables and given/known data: When looking for corefiles, include any file with core in its name. (Some UNIX/Linux systems add the PID of the process that created the core to reduce the chances of overwriting an already existing core file that might be needed. The... (6 Replies)
Discussion started by: s3270226
6 Replies

9. IP Networking

ddns-rev-domainname being created wrong.

Greetings all, I have been battling with this problem for some time now, and I am not sure if I am just not seeing the obvious anymore or have made a stupid mistake, but I just can seem to get the reverse address in my network to run the right way. Short description of my network: I have a... (3 Replies)
Discussion started by: Adesso
3 Replies

10. UNIX for Dummies Questions & Answers

Shell script which will sort all the files in a directory with the timestamp they were created

Team, Pls help writing a shell script which will sort all the files in a directory with the timestamp they were created. (like ls -lrt) (6 Replies)
Discussion started by: asappidi
6 Replies
Login or Register to Ask a Question