Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

Backup your work with rsync and ssh

Date: 2011-04-25 00:00:00 -0400

How to use rsync to backup over ssh?

rsync is a great tool to back up your work, this is the way I use it the most.

rsync -avz --delete /source/folder user@remote.server:/destination/folder

This way it creates a copy of the /source/folder to the /destination/folder in the remote server, and if a file has been deleted in the source server, it will be deleted from the remote one.

Now, if you want to run rsync over a different por of ssh, (I usually change the port where ssh listens, for security reasons).

rsync -avz -e 'ssh -p 4000' /source/folder user@remote.server:/destination/folder

Change 4000 for the port where you have sshd listening.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.