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 always do a mutual sync by issuing always "rsync -avuzb src dest" and then "rsync -avuzb dest src". If I use "rsync -avuzb ", already existing files are renamed to ~ on the destination, due to the b option. Now assume I have two files file and file~ on both, src and dst. The mutual sync now renames file~ to file~~ on each side. Although this is logically correct is is not practically desireble for me, since this means that the ~~~~~-files are piling up at each backup. Is there a way to only have one backup-file?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Try this additional parameter:

--exclude '*~'

to make:

rsync -avuzb --exclude '*~' src dst

Hope that helps.

share|improve this answer
    
Thanks. It's so embarrassingly obvoius. –  Christian Jun 30 '10 at 8:57

There is no problem. The ~~~ files won't pile up. On your source folder you would typically have: a.c and a.c~ Nothing else. Even if both files change many times the rsync folder will only have 3 files: a.c a.c~ a.c~~

share|improve this answer
    
Are you saying that the max number of files is three? So if OP ran that backup once more, he wont have a.c~~~? Which file gets replaced? –  Cfinley Jun 16 at 20:13

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.