Wednesday, January 9, 2008

Backup using rsync in Linux

Backup your Server's files to a remote host using rsync

Setup SSH RSA Authentication

#ssh-keygen -t rsa
#scp .ssh/ user@remote-host:/user/
#ssh user@remote-host
#cat >> .ssh/authorized_keys

Make sure that .ssh/authorized_keys has the following permission

-rw-r--r-- 1 user user 393 Jan 9 09:45 authorized_keys

Backup your folder to a remote host using rsync

rsync -avhe ssh --delete /folder-to-backup user@remote-host:/backup-folder


For an automated backup, use cron. For other rsync command switches, refer to the documentation or issue the command "man rsync"



No comments: