Last night in my zombified state I migrated from RHEL 5 to Debian Lenny as I need to brush up on my Debian skillz. This was alot easier than expected thanks to my good friend rsync. Since we are on this topic lets touch on how to rsync over ssh. The easiest way to do this is shown below:
# rsync -avz -e ssh /localdirectory firstname.lastname@example.org:/remotedirectory/
This command will connect to the other server via ssh, and copy the directory of /localdirectory to the root of /remotedirectory leaving all permissions and file attributes intact. The optimal way to use this in a backup scheme would be to implement ssh keys on the servers to allow for passwordless logins. This way you can execute a simple backup script via cron during any interval of your choosing. It is important to note that you should never use root on the backup server side when using keys as if this box gets compromised, you would not want the backup server to get rooted as well.