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

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

1 Answer 1

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.