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.
*nix filesystems provide 3 distinct timestamps:
mtime
is the time the file's contents was last modifiedctime
is the time the file's attributes were last changedatime
is the time the file was last accessedThe 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.
When I want to change the file modification time, I use an FTP client on the console. Log on with
ftp ftp.example.com
, thencd
commands go to the correct directorySITE
command to move the extended command modeUTIME somefile.txt 20050101123000 20050101123000 20050101123000 UTC
Change the access time, modification time, it's time to create a directory on 2005-01-01 12:30:00 somefile.txt. Complete example:
This link can help
https://superuser.com/questions/234158/show-both-ctime-and-atime-in-ls-output
stat -c '%x %z' filename.txt
as answered weeheavy