PDA

View Full Version : Backup with rsync + SSH?


stormrider
23rd October 2007, 21:57
Hello,

I'm currently backing up a server with rsync. I guess the default is to use rsh but i have read some stuff about it and it isn't secure ( right? ).

So i would like to use SSH but how can i do this without actually give an account to the user on the system?

I want something secure that only gives the user privileges to backup using rsync. Nothing more than this.

falko
24th October 2007, 22:14
Take a look here: http://www.howtoforge.com/mirroring_with_rsync

lwh.dk
10th November 2007, 16:28
What do you like to backup ?
Files, DB, mail ????

This is a sample on at script I'm currently is using to sync my two production servers backup filedirs once a week.
To make this script work you need to exchange ssh key's between the local user that's runnes the rsync backup script and the remote user that is used to auth the SSH connection with the rsync is using to secure the file copy.

#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
RemoteUSER=remotebackupuser
RemoteHOST=RemoteServerName
RemotePATH=/data/backup/MainServer
LocalPATH=/data/backup/

echo Running this command
echo $RSYNC -az -e ssh $LocalPATH$RemoteUSER@$RemoteHOST:$RemotePATH

$RSYNC -az -e ssh $LocalPATH$RemoteUSER@$RemoteHOST:$RemotePATH


Quit simple... after 5 hours with master GOOGle