Take the 2-minute tour ×
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@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

1 Answer 1

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.