Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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@10.10.10.10:/home/user/www

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?

Thanks

share|improve this question

rsync has a --delete flag: http://www.manpagez.com/man/1/rsync/

share|improve this answer

Your Answer

 
discard

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