2

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.

2
  • 1
    I'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... Commented Nov 21, 2022 at 23:31
  • Thanks for the quick reply. I'll try it out. Commented Nov 23, 2022 at 15:08

1 Answer 1

3

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

1
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .