Tuesday, August 11GNOME IT SOLUTIONS LLC

How to Use rsync for Backups on Linux Servers

Use rsync on Linux for fast, incremental backups and file synchronization.

Step 1: Basic Local Sync

Sync a directory locally: rsync -av /source/ /destination/

rsync local backup linux
Step 1: Basic Local Sync

Step 2: Remote Backup over SSH

Backup to remote server: rsync -avz -e ssh /data/ user@remote:/backup/

rsync remote backup ssh linux
Step 2: Remote Backup over SSH

Step 3: Automate with Cron

Add rsync to crontab for scheduled daily backups.

rsync automated backup cron linux
Step 3: Automate with Cron
rsync -avz --delete --progress /var/www/ backup:/var/backups/www/

Terminal screenshots are original illustrations created for Gnome IT Solutions (blog.gnomeitsolutions.com).