Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I retain date/time stamp when retreiving ftp files

Status
Not open for further replies.

Birbone

MIS
Dec 20, 2000
141
US
if so, what's the syntax

-B :cool:
 
For clarification; I'm wanting to retain the file(s) date/time stamp when retreiving it from a remote system. We normally just utilize the mget command, but now have a need for sorting by the files creation time.

-B :cool:
 

tar them up, transfer, untar them preserves times.

The general problem is that to preserve things, you need to be enabled and ftp (as a client) is not enabled (setuid).

If you can use scp, I believe that preserves times.

Lastly, I have written "retouch" scripts where you record the ownership/times in a flat file then restore them by running a "restore" script. This must be root enabled to restore, however.

gene

 
Code:
man ftp | col -b | grep preserve
Reformatting ftp(1), please wait...
     preserve    Toggle preservation of modification times on retrieved files.

I'm using SuSE Linux, but FTP is pretty standard, isn't it? Anyway, check your FTP man page.

The tar idea would work, too.

If you want to do it the hard way, you could write a script that calls FTP twice with heredocs and use [tt]ls -ltr[/tt] and [tt]cut[/tt] to get the date/time stamps on the first run, then [tt]touch -d[/tt] after the files are written to change the time to what it was on the FTP server.

Of course there's Perl and Net::FTP [cyclops]

--
-- Ghodmode
 
Ghodmode said:
FTP is pretty standard, isn't it?

Unfortunately, no it isn't. There is no mechanism (as far as I know) to do this in vanilla Solaris (8, not sure about 9 or 10) and the AIX man page recommends using rcp to preserve attributes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top