Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to copy a bunch of folders recursively. However, I don't want one error preventing the copy from finishing. Is there any way to do a recursive copy(cp -R), ignoring (but logging) all errors produced? I'm on Mac OS X, but I assume the answer would be the same for *nixes.

share|improve this question
add comment

2 Answers

up vote 12 down vote accepted

Hey, you might want to check out rsync ( http://www.samba.org/ftp/rsync/rsync.html ). It can do a more reliable job and only copy the files that didn't copy the first time:

rsync -vza --progress /source/ /destination/

Good luck!

share|improve this answer
    
This is awesome. Thank you! –  benjy Apr 15 '13 at 17:54
    
Absolutely exactly what I needed, with a springling of --exclude="<globpattern>" and --delete to keep a try perfectly synched from one project to the next. –  Martijn Pieters Feb 6 at 16:17
add comment

Found the answer: ditto(1)

share|improve this answer
    
Please share it here so that future people can learn.. –  James Polley Jan 5 '10 at 10:21
    
I did share the answer... it is ditto. Syntax: ditto <src dirs> <dst dir> –  Mike Jan 5 '10 at 10:25
    
Odd; when I first viewed this it was a broken image. –  James Polley Jan 5 '10 at 10:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.