After reviewing old posts, I tried various arguments to the cp command in Terminal (e.g., -p, -a, -R) attempting to copy folders/files to an external drive while keep attributes like "Date Created" the same as the source. No matter what I've tried the dates are not preserved. Helpful advice would be greatly appreciated.
-
1I'm not a big user of the command line but if I recall the command that preserves file attributes and resource forks is ditto rather than cp. Never used it myself but maybe that will point you in a helpful direction...– Steve ChambersCommented Nov 21, 2022 at 23:31
-
Thanks for the quick reply. I'll try it out.– HeyOldGuy61Commented Nov 23, 2022 at 15:08
Add a comment
|
1 Answer
Use ditto
instead of cp
. ditto
copies hierarchies by default (so no need for -r
) so ditto src_folder /Volumes/external_drive
most likely will be enough (but check the man page for details).
PS: Ability to preserve attributes depends on the format of the target device (so if you copy to a FAT-formatted drive some attributes will be lost).
-
Thanks for the quick reply. You nailed it with the formatting comment. My backup external HD is formatted ExFat so I can take videos back and forth between Mac and PC. Ditto worked fine duplicating files from one Mac folder to another. Commented Nov 23, 2022 at 15:11