Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I usually backup from server1 files to a server2 machine by doing the following in server1

rsync --progress -avhe ssh www/ user@

What I'm looking for is to completely synchronize files on server2 based on what is currently on server1. I know that there are several extra files on server2 that probably I want to remove.

How could I perform this using rsync?


share|improve this question

rsync has a --delete flag:

share|improve this answer

Your Answer


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