Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Some of the files we receive on our Redhat server are showing date different from upload date as the last modification time. For us the modification time is important as we classify files depending on date we receive it. Some of these file show earlier timestamps, maybe that of files original creation/modification date on client machine.

share|improve this question

1 Answer

up vote 1 down vote accepted

*nix filesystems provide 3 distinct timestamps:

  • mtime is the time the file's contents was last modified
  • ctime is the time the file's attributes were last changed
  • atime is the time the file was last accessed

The timestamp usually shown in directory listings is the mtime, because it is the most useful; however, many FTP servers will upload a file to a temporary filename and then rename the file once complete, to avoid exposing incomplete files to the OS.

This causes the mtime and ctime to differ for newly-created (uploaded) files; the ctime will show the time the file finished uploading and was renamed, while the mtime will show file creation time.

If you can show some samples of what you're talking about, perhaps additional help can be offered.

share|improve this answer
Thanks for your explanation. I was able to list all the files that came yesterday using -ctime -1 flag for find which I wasn't with with -mtime flag. So ctime will always show the upload time-stamp, right? – nitins Jan 15 at 11:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.