I would like to copy the contents of a whole disk into another folder on an external drive.
it should preserve permissions and timestamps.
on linux i use
cp -a but on OSX it seems to be different
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
cp -a is just a shortcut for
cp -pPR, these options are available in the 10.3 version of cp already. So you can copy the content of your disk with
cp -pPR /old/path /Volumes/new/path
You can also avoid using Terminal altogether and just drag the top folder you want to keep onto the external drive in Finder.
Download Carbon Copy Cloner 2.3. It is compatible with your version of MacOS X and processor. This solid software will preserve all the ACL, all the permissions and all the hidden files of your whole file system.
Once you have made your external copy, check it with the original
Don't use a more recent version of
Disk Utility which will want to fix many discrepencies…
If you want to take a backup of your whole disk, while maintaining permissions, ACLs, timestamps, symlinks, etc... I would recommend to use
tar instead of
Something like this:
tar cjvf mybackup.tar.bz2 <source>
and then extract the tar file in another location
tar xjvf mybackup.tar.bz2
To avoid the temporary file (which may be quite big) you can pipe them together
cd /path/to/source; tar cf - . | (cd /path/to/dest; tar xpf -)
Of course, if you are backing-up file a filesystem, shared by several users, you may need to do so as a root to overcome permissions problems.
Another useful method is to use
cpio. It can preserve hard links and can handle some long filenames which are not supported into tar.
You can check more details here for a nice comparison between the three techniques.
I believe all of the methods word, you should just fine that suits your needs and do the job more efficiently.