Using rsync to Mirror Data to a Different Server

Like many things on this blog, I don’t use this enough to remember the full command when I need it. Like always, don’t just copy and paste this information. Use the man pages to verify what it is that you need to do.

rsync -a -v --delete --update --stats /path/to/local/data/ user@<server-name>:/path/to/folder/

This version of the command essentially maintains ownership and permissions while allowing for file changes, including file deletions, to be copied from the local server to another server. It mirrors the data on the local server to a second server. It also provides a listing of statistics when the command has completed.

A similar command using robocopy on MS systems was posted at an earlier date and can be found here: