Sasun Posted June 23, 2004 Report Share Posted June 23, 2004 Does anyone know how to ftp files in UNIX and keep the original date in the new location? I am not sure if it is at all possible as man ftp says nothing about the date. Quote Link to comment Share on other sites More sharing options...
vava Posted June 23, 2004 Report Share Posted June 23, 2004 I've never looked into it - I always have that 'problem' in that the date of the files uploaded to the FTP are actually the date of the transfer, and not the date of the last modification of the file. There maybe there's a utility to help track transfers and file save dates, but I'm not sure. How important is this (to know the actual dates?) Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 23, 2004 Author Report Share Posted June 23, 2004 I am migrating to a new unix machine, and with the lack of file documentation the dates are a great help to me. I guess it is not critical but having the right dates is quite essential for me as I am a minimalist when it comes to documenting or remembering what file was created when and why. For example, someone will make an inquiry about an old project referring to an email. I will check the date of the email, then look for programs and files created around that date and will quickly refresh what I have done before. Now if I don't have the correct update date it will be much harder to find anything. Quote Link to comment Share on other sites More sharing options...
Anileve Posted June 23, 2004 Report Share Posted June 23, 2004 Which Unix Sasun? Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 23, 2004 Author Report Share Posted June 23, 2004 SunOS 5.9 Quote Link to comment Share on other sites More sharing options...
Sip Posted June 23, 2004 Report Share Posted June 23, 2004 Off the top of my head, an easy solution may be to tar the files, ftp, then untar. Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 23, 2004 Author Report Share Posted June 23, 2004 Off the top of my head, an easy solution may be to tar the files, ftp, then untar. Hmm... that's a good solution Sip, I am willing to spend time tarring and untarring if that is the cost. Actually I haven't used tar before, do you know if tarring keeps the old files? (like winzip). It would cause me space issues. And can you tar a file that is already compressed? Quote Link to comment Share on other sites More sharing options...
Sip Posted June 23, 2004 Report Share Posted June 23, 2004 tar doesn't compress. It just packs files together for archiving. Then you can use gzip or zip the tar. There may be an option to delete the old files not sure. But the way I do it, it just creates an archive in addition to the files. To tar all the files in a directory: tar -cvf tarfile.tar * to untar tar -xvf tarfile.tar I tried it in Solaris and it preserves file dates. The other option maybe to export the ftp directory and actually mount it as part of the file system. Then to move the files. Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 23, 2004 Author Report Share Posted June 23, 2004 Thanks Sip, let me try tar and see what happens. Quote Link to comment Share on other sites More sharing options...
vava Posted June 24, 2004 Report Share Posted June 24, 2004 This solution works on our Red Hat distribution as well as the mandrake linux i keep kicking around on an old machine. I suppose it's woirth the time to Tar & un-tar... Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 24, 2004 Author Report Share Posted June 24, 2004 Good to know, I think it will work on unix too. I haven't had a chance to try yet. Quote Link to comment Share on other sites More sharing options...
Sasun Posted June 25, 2004 Author Report Share Posted June 25, 2004 I tried tar, it works great (except some weird write permission issues which could be for some other reason). I like particularly the {-I include-file} option, it is very helpful. Sip, as always you are on top of giving a useful advice I don't think there is an easier way to do this task. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.