Jump to content


Photo
- - - - -

Ftp With Original Date


  • Please log in to reply
11 replies to this topic

#1 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 09:56 AM

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.

#2 vava

vava

    :yawn:

  • Members
  • PipPipPipPipPip
  • 5,234 posts
  • Gender:Male
  • Location:Canada

Posted 23 June 2004 - 10:24 AM

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?)

#3 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 10:34 AM

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.

#4 Anileve

Anileve

    Epicure Maximus

  • Members
  • PipPipPipPipPip
  • 2,201 posts
  • Gender:Female
  • Location:NYC
  • Interests:Running around at dawn and poking innocent bystanders with pipe cleaners.

Posted 23 June 2004 - 10:37 AM

Which Unix Sasun?

#5 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 10:58 AM

SunOS 5.9

#6 Sip

Sip

    Buffet Connoisseur

  • Members
  • PipPipPipPipPip
  • 8,365 posts
  • Gender:Male
  • Location:Online

Posted 23 June 2004 - 11:02 AM

Off the top of my head, an easy solution may be to tar the files, ftp, then untar.

#7 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 11:10 AM

QUOTE (Sip @ Jun 23 2004, 01:02 PM)
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?

#8 Sip

Sip

    Buffet Connoisseur

  • Members
  • PipPipPipPipPip
  • 8,365 posts
  • Gender:Male
  • Location:Online

Posted 23 June 2004 - 11:29 AM

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.

#9 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 11:33 AM

Thanks Sip, let me try tar and see what happens.

#10 vava

vava

    :yawn:

  • Members
  • PipPipPipPipPip
  • 5,234 posts
  • Gender:Male
  • Location:Canada

Posted 23 June 2004 - 08:46 PM

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...

#11 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 23 June 2004 - 08:50 PM

Good to know, I think it will work on unix too. I haven't had a chance to try yet.

#12 Sasun

Sasun

    Veteran

  • Members
  • PipPipPipPipPip
  • 5,533 posts
  • Gender:Male
  • Location:NJ, USA
  • Interests:Art, Yoga, Spirituality

Posted 25 June 2004 - 10:11 AM

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 smile.gif I don't think there is an easier way to do this task. Thanks wink.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users