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 have the following 2 source folders:

  • A is the base folder, its size is 1GB.
  • B is the change folder, its size is 100K. B has the same folder structure with A, but files only exist when it needs to be different with A.

What I want is "A + B = C". I clone A folder to C folder with rsync first. And then I use rsync again to overwrite the files in C folder from B folder.

The problem is that it still takes too much time even if the C folder exists. Any solution to fasten this process?

share|improve this question
    
Is there a reason you're using rsync? Why not just cp -r A C, then cp -r B/* C? –  Nicole Hamilton Jan 14 '13 at 4:40
    
With rsync I can exclude unnecessary files easily. I don't know how to do that with cp. –  josephj Jan 14 '13 at 4:59
    
How do you decide what's "unnecessary"? If you thinking about the case where C already exists and may already have some up-to-date files, use the cp -u option to copy only when the source is newer than the destination or when the destination is missing. –  Nicole Hamilton Jan 14 '13 at 5:20
    
what are the rsync options that take too long for copying B to C? –  sparkie Jan 14 '13 at 5:23
    
@NicoleHamilton It means something like .git or the application folder which doesn't have to be included in this deployment. However, use the cp -u is indeed faster than rsync. I might change my approach for that. –  josephj Jan 14 '13 at 5:49
show 5 more comments

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.