Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to copy a /home/user folder from one hard disk to another one. It has 100,000 files and around 10G size.

I use

cp -r /origin /destination

sometimes I get some errors due to broken links, permissions and so on. So I fix the error, and need to start again the copy.

I wonder how could I tell the command "cp", once it tries to copy again, not to copy files again if they exist in the destination folder.

share|improve this question

migrated from stackoverflow.com Mar 11 '10 at 16:51

5 Answers

up vote 4 down vote accepted
cp -R -u -p /source /destination
share|improve this answer

Don't us cp. Use rsync instead.

share|improve this answer

rsync -aq /src /dest

Apart from only copying newer files, it will even only copy the newer parts of files if the file has changed. It's intended for copying over network links where you want to minimise the amount of data - but it also works great locally.

share|improve this answer

Look up the "-u" option for the cp command.

share|improve this answer

You should be copying as root to maintain permissions/ownership

# cp -au

Also look at rsync

share|improve this answer

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.