LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-01-2009, 12:19 PM   #1
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Rep: Reputation: 15
Modified Date


Hi this may not be in the correct category (forgive me if thats the case). We have a Linux back end system that is constantly creating files. We had a situation where we ran an ls inside a directory and the file date showed jul 1st. Which seemed normal because a program was probably modifying that file on today's date. When we ran a second ls one minute later it showed a file date of jun 28th. Does anyone out there have an explanation as to how this can happen? No manual modification via touch was done, so i'm not sure as to how a file date can go back in time without a user running touch on it. Your help is greatly appreciated.

To clarify the file date was on one specific file inside the directory, sorry should have mentioned that.

Last edited by kernelzack; 07-01-2009 at 12:23 PM.
 
Old 07-01-2009, 01:13 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by kernelzack View Post
Hi this may not be in the correct category (forgive me if thats the case). We have a Linux back end system that is constantly creating files. We had a situation where we ran an ls inside a directory and the file date showed jul 1st. Which seemed normal because a program was probably modifying that file on today's date. When we ran a second ls one minute later it showed a file date of jun 28th. Does anyone out there have an explanation as to how this can happen? No manual modification via touch was done, so i'm not sure as to how a file date can go back in time without a user running touch on it. Your help is greatly appreciated.

To clarify the file date was on one specific file inside the directory, sorry should have mentioned that.

Modification date can be set from a program; archiving/compression program like 'tar', 'gzip' preserve date of the original file.
 
Old 07-01-2009, 01:21 PM   #3
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,995
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
All dates in UNIX/Linux are stored in UTC (universal time code) which is the same as GMT.

However, when you "see" a date it is displayed by your time zone setting. You can modify how you see it by changing the variable TZ in your login. That could change apparent time (and date depending on when Midnight occurs in the different time zones). However while I've seen that cause variances of 24 hours or so I've never seen it cause 2-3 days like you indicate.

One reason I do often see such time reversion is during a restore from a backup (or a tar archive or cpio or dd etc...). While it is in the process of doing the restore the time it has on the file will be the current time. However once it is done with the restore the time will revert to the time on the restored file. So if I'm restoring a full backup from yesterday I'll see the current file being restored has the current time but all the other files already restored now have yesterday's time on them. (It could even be earlier than yesterday if the file was created some days before the backup.)

Other than that I've never seen anything suddenly revert a date.
 
Old 07-01-2009, 01:38 PM   #4
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
Exclamation

Your questions looks like magic. You have to specify few more things here

Quote:
Originally Posted by kernelzack View Post
We have a Linux back end system that is constantly creating files. We had a situation where we ran an ls inside a directory and the file date showed jul 1st. Which seemed normal because a program was probably modifying that file on today's date. When we ran a second ls one minute later it showed a file date of jun 28th.
So you have a backup server. Where you have run the command i mean on backup server or in main server. How are you using this backup server.
By which command or by which method you have taken backup.

How many admins are there who have access to this server. Linux is not a magic, what ever happens there we are responsible for it. There are many ways and reasons.
 
Old 07-01-2009, 02:29 PM   #5
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by vap16oct1984 View Post
Your questions looks like magic. You have to specify few more things here



So you have a backup server. Where you have run the command i mean on backup server or in main server. How are you using this backup server.
By which command or by which method you have taken backup.

How many admins are there who have access to this server. Linux is not a magic, what ever happens there we are responsible for it. There are many ways and reasons.
While I thank you for taking the time to help me..... I do not need you to insult my inteligence, judging by the two other posters above who have been helpful to me they are not aware of how this can happen either. I indicated that the human element was not a factor in my post. As for the server role it would take me quite a while to explain, so i won't. in order to save time and make sure people who are tying to be helpful can get to the actual problem. " Linux is not a magic" I am aware that Linux is not indeed magic, it is a computer operating system. I did not ask how many rabbits my linux kernel can pull out of its hat. I am sorry if i offended you in such away that you had to insult me. THANK YOU To the two above you very much, i thought it was a little strange and I can't find an explanation i will dig deeper into the problem. THanks!
 
Old 07-01-2009, 03:02 PM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,995
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
Try running "lsof <file>" to see if the file is "open". It may be there's a process updating it of which you're unaware. The lsof command would show any PID that has the file open but won't show PIDs of files that rely on it but aren't holding it open.
 
Old 07-01-2009, 06:21 PM   #7
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,067

Rep: Reputation: 491Reputation: 491Reputation: 491Reputation: 491Reputation: 491
Quote:
Originally Posted by kernelzack View Post
.... I do not need you to insult my inteligence...
IMHO vap16oct1984 asked sincere questions help you discover the cause. At the same time he tried to emphasize that such things do not just happen by magic. As far as I can recall I have never seen any report of magically changing dates due to a erroneous operating kernel or file system. Thus whatever happens must be a result of a certain action carried out by a human being. That doesn't mean that such an action can not be very well hidden and totally obscure.

Still I don't think vap16oct1984 deserves a pissed off reaction like you gave.

jlinkels

Last edited by jlinkels; 07-02-2009 at 08:52 AM.
 
Old 07-02-2009, 01:28 AM   #8
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
Well kernalzack:
i guess you have made a negative sense of mind frame here.I am still trying to help you.

I have seen many cases of time changed related issue. Where people things that it happens
automatically.And its not the first time that i heard the case as you described here like time has changed automatically within 1 min. So i am more queries to figure out the where is the actual problem.

But the way you talk its like kids is playing with linux. I am sorry if i heart you.
But its not my intension. What i want is to prove here is that if its happed and the time
stamp of file is changed automatically then there must be some solid reason behind it.

i am not insulting your intelligence. i know no one is perfect in this world. We all are learning each day. Its good if we know more about linux.

So pls answer my questions that i asked before. Its really help me and others to help you.
So that exactly we tell where is the problem and why this happen????

Jlinkels:- Thanks a lot jlinkels, for understanding my views and point.

thanks
 
Old 07-02-2009, 10:13 AM   #9
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlinkels View Post
IMHO vap16oct1984 asked sincere questions help you discover the cause. At the same time he tried to emphasize that such things do not just happen by magic. As far as I can recall I have never seen any report of magically changing dates due to a erroneous operating kernel or file system. Thus whatever happens must be a result of a certain action carried out by a human being. That doesn't mean that such an action can not be very well hidden and totally obscure.

Still I don't think vap16oct1984 deserves a pissed off reaction like you gave.

jlinkels
"So you have a backup server. Where you have run the command i mean on backup server or in main server. How are you using this backup server.
By which command or by which method you have taken backup."

First off I never said anything about a backup server period. So This entire paragraph is gibberish. It is like kids playing around. second "Your questions looks like magic." I was very serious in my post and judging by the other two replies i specified enough information in order to receive help which i appreciate. I'm not sure what part you thought was magical about my question or maybe you just didn't pay attention and thought i was talking about running commands off backup servers. Who really knows. So jinkels when someone says your questions look like magic, i'm sorry my friend but that is an insult. I realize how absolutely unlikely this is to happen with out human intervention thats why i turned to this forum. I wanted to ask people who have alot more experience at the same time i'm not a little kid and i was being very serious. So the main reason i was offended was vap did not even read my paragraph, he started asking questions about backup servers and main servers, I have a machine that operates on the backend that process credit card info and pulls data from mysql servers also on the backend. Then after he misread my question he told me it looks like magic, it might not have looked so magical if you would have read it right the first time, then ontop of it you tell me i'm nuts. I KNOW THIS IS UNLIKELY THAT THIS COULD HAPPEN I WAS CHECKING IF A GURU HAS EVER SEEN THIS EVER BEFORE BECAUSE I HAVE NOT! Thanks.

Last edited by kernelzack; 07-02-2009 at 10:27 AM.
 
Old 07-02-2009, 02:42 PM   #10
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,995
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
It was I that mentioned backup (or restore of same) as an example of something that can cause such apparent reversion of timestamp on a file.

Did you try the lsof command suggested?
 
Old 07-02-2009, 04:14 PM   #11
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlightner View Post
It was I that mentioned backup (or restore of same) as an example of something that can cause such apparent reversion of timestamp on a file.

Did you try the lsof command suggested?
Yes, I did try that and at the time of running the command the file was not open. I will try again hopefully something turns up. I appreciate the help thanks!
 
Old 07-03-2009, 05:42 AM   #12
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
Thumbs up

@kernelzack
Quote:
Originally Posted by kernelzack View Post
First off I never said anything about a backup server period. So This entire paragraph is gibberish. It is like kids playing around.
Well thanks for this comment. I think there some misunderstanding or
miss belief has developed here. And all these may be because of your
little confusing post that you have post very first day and you mensioned about Linux backend.Looks your post

Quote:
Hi this may not be in the correct category (forgive me if thats the case). We have a Linux back end system that is constantly creating files.
So who has written all this if not you?????


Quote:
I was very serious in my post and judging by the other two replies i specified enough information in order to receive help which i appreciate.
I had never said that you are not serious about your post. And dont judge your questions by other replies. Yes you have given information
and i dont think there is any issue if you can give some more information. It not only helps me but to some more people to wants resolve the issue.


Quote:
So jinkels when someone says your questions look like magic, i'm sorry my friend but that is an insult.
First of all make it very clear that i am not tring to insulting an body. If you feels my words heart you then i am sorry. By saying magical
i have given importance to the question. Lets us try to find out where the magic lies and why this happen thats it.

Quote:
So the main reason i was offended was vap did not even read my paragraph, he started asking questions about backup servers and main servers,
Well Kernelzack i have go through each and every word that you have written. Not only yours word but each and every response that you got here by other Gentleman. And after reading all this i am asking you questions. I really surprised how you got this idea "vap did not read your paragraph".

thanks...
 
Old 07-03-2009, 11:18 AM   #13
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by vap16oct1984 View Post
@kernelzack


Well thanks for this comment. I think there some misunderstanding or
miss belief has developed here. And all these may be because of your
little confusing post that you have post very first day and you mensioned about Linux backend.Looks your post



So who has written all this if not you?????




I had never said that you are not serious about your post. And dont judge your questions by other replies. Yes you have given information
and i dont think there is any issue if you can give some more information. It not only helps me but to some more people to wants resolve the issue.




First of all make it very clear that i am not tring to insulting an body. If you feels my words heart you then i am sorry. By saying magical
i have given importance to the question. Lets us try to find out where the magic lies and why this happen thats it.



Well Kernelzack i have go through each and every word that you have written. Not only yours word but each and every response that you got here by other Gentleman. And after reading all this i am asking you questions. I really surprised how you got this idea "vap did not read your paragraph".

thanks...
Vap, you did call me a little kid playing with linux and you do not know the difference between a backup system and a backend system. Let me help you out.... http://www.google.com/search?hl=en&q...=f&oq=&aqi=g10

http://www.google.com/search?hl=en&q...=f&oq=&aqi=g10


So please I know you were trying to help but read carefully before you start making cracks at me. This is ridiculous that your still trying to plead your case, i said nothing of backup systems so main servers or backup servers do not come into play here. I used the term backend so i would not have to explain the servers role because it is quite complex. I'm sorry if i confused you like you said it is like little kids playing with linux.
 
Old 07-03-2009, 02:15 PM   #14
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
Lightbulb

@kernelzack
Quote:
Originally Posted by kernelzack View Post
Vap, you did call me a little kid playing with linux and you do not know the difference between a backup system and a backend system.
How nice you are, without understanding the concept you are arguing
with me. If you look the concept logically it does not matter especially
if we are taking about updates of file from one server to other. It does not matter which server? Only thing is that in both cases (either its backend or backup server) at least two servers are required to talk with each other.

Please dont go through the definitions only use your mind and think
logically. Thats really work.Always try to relate the concepts an this really help you.
 
Old 07-03-2009, 02:47 PM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,155
Blog Entries: 54

Rep: Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795
Could you both please stop the bickering and just focus on solving the problem?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change modified date stamp of file B-Boy Linux - Newbie 2 08-21-2008 07:33 AM
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 09:59 AM
Created and Modified date linux2man Linux - Newbie 1 08-13-2007 12:10 PM
[bash] Seeing if a file has been modified before/after a date w3stfa11 Programming 7 10-15-2006 06:02 PM
Where can I look for the config file for modified date and time ForumKid Linux - General 1 09-19-2003 08:05 AM


All times are GMT -5. The time now is 02:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration