LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Modified Date (https://www.linuxquestions.org/questions/programming-9/modified-date-736993/)

kernelzack 07-01-2009 12:19 PM

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.

Sergei Steshenko 07-01-2009 01:13 PM

Quote:

Originally Posted by kernelzack (Post 3593209)
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.

MensaWater 07-01-2009 01:21 PM

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.

vap16oct1984 07-01-2009 01:38 PM

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

Quote:

Originally Posted by kernelzack (Post 3593209)
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.

kernelzack 07-01-2009 02:29 PM

Quote:

Originally Posted by vap16oct1984 (Post 3593280)
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!

MensaWater 07-01-2009 03:02 PM

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.

jlinkels 07-01-2009 06:21 PM

Quote:

Originally Posted by kernelzack (Post 3593323)
.... 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

vap16oct1984 07-02-2009 01:28 AM

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

kernelzack 07-02-2009 10:13 AM

Quote:

Originally Posted by jlinkels (Post 3593519)
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.

MensaWater 07-02-2009 02:42 PM

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?

kernelzack 07-02-2009 04:14 PM

Quote:

Originally Posted by jlightner (Post 3594659)
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!

vap16oct1984 07-03-2009 05:42 AM

@kernelzack
Quote:

Originally Posted by kernelzack (Post 3594407)
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...

kernelzack 07-03-2009 11:18 AM

Quote:

Originally Posted by vap16oct1984 (Post 3595353)
@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.

vap16oct1984 07-03-2009 02:15 PM

@kernelzack
Quote:

Originally Posted by kernelzack (Post 3595695)
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.

unSpawn 07-03-2009 02:47 PM

Could you both please stop the bickering and just focus on solving the problem?


All times are GMT -5. The time now is 04:25 PM.