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 use rsync in the following manner:

rsync -Pvaz me@192.168.*.***:Documents/ /Users/me/Documents/
rsync -Pvaz /Users/me/Documents/ me@192.168.*.***:Documents/ 

The problem: if I delete a file on my home computer and sync, it doesn't get deleted on the remote computer. Is there a way to use rsync to literally sync two folders?

share|improve this question
    
This question tipped me how to sync my computer at home and my home directory in the office without bothering about server names etc. of my connection at home. Namely, just swap source and destination... –  Dror Feb 8 '12 at 9:34

2 Answers 2

up vote 15 down vote accepted

Man page for rsync:

 --delete                delete extraneous files from dest dirs
 --delete-before         receiver deletes before transfer (default)
 --delete-during         receiver deletes during xfer, not before
 --delete-delay          find deletions during, delete after
 --delete-after          receiver deletes after transfer, not before
 --delete-excluded       also delete excluded files from dest dirs
share|improve this answer

I am not a rsync expert and there may be a switch that can do what you want and someone else may say.

However, personally, I use rsync when I need one way copying. When it comes to synchronise two locations, I use Unison which is built on top of Rsync and basically makes it easier.

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.