I know that FTP does not support transferring and retaining file date/time stamps
Wondering if anyone has any ideas/scripts (Shell/perl) that would retain a transfered file’s timestamp after a put operation?
I know that FTP does not support transferring and retaining file date/time stamps Wondering
Share
One option is
rcp -p. I’m sure some equivalent exists for more securescpas well.As noted by Autocracy, if you can, just tar/zip/otherwise archive the file before transferring and revert back. Unfortunately this doesn’t always work – say if you don’t have control/acces to the file’s source server.
Alternately, after “get”-ting the file via FTP, change timestamp to the correct one using Perl’s
utime()or Unix’stouchcommand.The caveat is if you’re putting the file onto a remote server, you need to connect (ssh/telnet/rsh) to run the touch command. Kinda cumbersome and not what I’d recommend, but a valid solution even for “put”.