Rsync, two-way sync, and syncing file-deletion operations

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?

1

2 Answers

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

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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like