Chris Nizzardini, Salt Lake City Utah, Web Developer Specializing in LAMP+Ajax Since 2006

My Blog

Here is my awesome blog.

rsync debian linux

Install rsync on the server you want to backup apt-get install rsync

To backup the entire server create a cron job with the following command in it (you can choose how often you'd like it to run yourself if you know how the time syntax in a cronjob, otherwise search the blog for information on crontab):

rsync -a -e ssh / username@10.10.10.10:/path/to/destination/

Since you will be doing this over SSH you will be prompted for a password, but we can't really enter in a password if this is a cronjob. So on the source system and source user that the cron job will run as enter in the following command and when it asks for a password leave it blank, take the default file location:

ssh-keygen -t rsa

Do the same thing on the destination system, but remember to run the command as the user who will be logging in via SSH for the rsync conrjob.

Open ~/.ssh/id_rsa.pub on the source system and create a new file on the destination system called /home/username/.ssh/authorized_keys, copy the line in the id_rsa.pub to the authorized_keys files. Verify you can SSH into destination system from the source system.

This has just made your backup server pretty insecure, but since it is just a backup server you can restrict who can log into the system via SSH to the source computer.

One Response to “rsync debian linux”

Leave a Reply