Best way to copy all files, ignoring errors

copy/pastedata-recoveryfile-transfer

I have a partially corrupted HD that can not be repaired by Disk Utility, but which can be mounted read-only making the data on it accessible.

I am trying to copy all the recoverable contents onto a spare HD, but every method I try fails when an error is encountered – leaving the remaining files uncopied.

Finder – Fails.
SuperDuper – Fails.
Ditto (terminal command) – Fails.

I was hoping that Ditto would do the trick, the Ditto man page says:

ditto returns 0 if everything is copied, otherwise non-zero. ditto
almost never gives up, preferring to report errors along the way.
Diagnostic messages will be printed to standard error.

I have submitted a bug to Apple re ditto failing to perform as advertised.

Any other ideas?

Best Answer

I use cp -Rfv sourcefile destinationfile with success on a pretty regular basis.

cp = copy

R = maintains file hierarchies

f = if an existing destination file cannot be opened, remove it and try again

v = verbose mode, displays files transferred as it progresses

sourcefile = data you want to copy

destinationfile = directory/drive you want to copy to