Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm interested in combining the files from three Macs by copying the files from each one into a single folder hierarchy of my design on an external hard drive.

In my past experience copying files in OSX, sometimes the files lose their Created and Modified timestamps; i.e. they are changed to the present moment when the file copy happens.

How can I make sure this doesn't happen?

share|improve this question
When do you lose timestamps? – lhf Jan 31 at 11:06
Copying them how? – Gerry Jan 31 at 11:20

3 Answers

I use rsync to do this sort of copy

for example

rsync -aE source_dir target_dir

The option E copies the ACLs and a does the unix permissions and times.

rsyunc can also be setup to copy to remote machines without mounting drives.

There are some GUI front ends for rsync e.g. aRsync. For other directory synchronization tools see this question.

share|improve this answer
rsync is a good solution, but be aware that it doesn't preserve access times. pax (see my answer below) does. – jaume Feb 18 at 10:26

Use pax. The default pax format, called ustar, preserves file modification and access times (among other things like user ID, group ID, file mode bits and extended attributes like Spotlight comments and ACLs). See pax man page here for more details.

First, create a pax archive on every Mac and copy it to the external hard drive like this:

  1. Open Applications>Utilities>Terminal.
  2. Type in Terminal:

    $ cd
    

    and drag the folder where the files to be combined reside on that Mac to Terminal:

    enter image description here

    Alternatively you can type the full folder name:

    $ cd /path/to/your\ folder
    

    This will change the current folder to 'your folder'.

  3. Archive the folder with pax:

    $ cd ..
    $ pax -w "your folder" > yourfolder.ustar
    
  4. Use the Finder to copy the newly create archive yourfolder.ustar to the external hard drive.

Then extract the archives with pax:

  1. Open Terminal on the Mac that has the external USB hard drive plugged in.

  2. Change the current folder to the single folder hierarchy on the external hard drive with command cd as explained above:

    $ cd /Volumes/externalHDD/path/to/single \folder
    $ ls
    yourfolder.ustar
    yourfolder2.ustar
    yourfolder3.ustar
    
  3. Extract the archives:

    $ pax -r -p e < yourfolder.ustar
    $ pax -r -p e < yourfolder2.ustar
    $ pax -r -p e < yourfolder3.ustar
    $ ls
    your folder
    your folder 2
    your folder 3
    
  4. Move the files around with the Finder if you need to (the Finder preserves file modification and access times within the same volume).

(I've tested this procedure on OS X 10.8 (Mountain Lion).)

share|improve this answer

Compress them with zip or option-click and choose Compress. Copy the compressed files to your target system and open them there.

If you can, format your external drive as a Mac OS filesystem, not FAT.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.