Apple - How can I back-up an external drive while preserving attributes, folder creation date and showing progress?
Just after I posted this question I found a solution.
I noticed that the rsync: get_xattr_names
errors all had one thing in common: the files that raised the error where always ._
files.
I read that ._
files are used to store information that would go into a HFS+ extended attribute. As I'm copying between HFS+ drives I figured I don't need these files.
So I added an --exclude
argument to my rsync command which excludes all filenames that start with ._
rsync --exclude="._*" --recursive --info=progress2 -hhh --xattrs --times --crtimes /Volumes/origin/ /Volumes/destination
The command:
- Filters
._
files beforehand (--exclude="._*"
), preventingget_xattr_names
errors. - Preserves the folder creation dates via the
--times --crtimes
argument. - Preserves Finder colour labels via the
--xattrs
argument. - Shows progress in a human readable format via the
--info=progress2 -hhh
argument. - (Added bonus: preserves custom folder icons as well, via the
--xattrs
argument)