easy remote to local file backup using rsync

I previously posted about a non-rsync solution to backup files.

Well, that is not efficient, (nor was it working properly, sorry). The script to create the backups is still very handy.

Using rsync to sync remote to local

I tried rsync to sync files from remote to local and I have to admit it’s blazing easy to use.
A single line downloads the backup files to the local folder:

-v means verbose, -z is to compress during transfer, -r is recursive and -e specifies SSH.

The first path with host and user is the SOURCE, where you take the files from, the second path is the DESTINATION locally, where you want to put the files.

You probably have to tell it where the SSH private key is and which user to login with SSH, put that into quotes after the -e flag.

Way easier than scripts that didn’t even work huh?

Limit bandwidth

You can also limit the bandwidth using --bwlimit=XX argument (it’s in Kilobyte):

When you get Unexpected remote arg:

When you get this error, it’s due to either wrong user and/or SSH configuration.
Important is that you have the -e directly followed by 'ssh'.

One thought on “easy remote to local file backup using rsync

  1. Pingback: Automatic file and MySQL backup with SFTP transfer - FLOWL blog | php - security - linux - analytics

Leave a Reply

Your email address will not be published. Required fields are marked *