Right now I'm running using rsync for server backups. I'm wondering whether I should use daemon mode for rsync. Are there any differences in performance?
## Constants
BACKUP_SYSTEM="example.com"
LOCAL_RSYNC_PORT="1873"
REMOTE_RSYNC_PORT="873"
## Create the ssh tunnel
ssh -2 -N -T -f -L $LOCAL_RSYNC_PORT:localhost:$REMOTE_RSYNC_PORT $BACKUP_SYSTEM
## Test if the connection was successfull, otherwise exit
if [ $? -eq 255 ];
then
exit
fi
## Verify the PID and store it for a future kill order
SSH_TUNNEL_PID=`ps aux | grep 'ssh -2' | grep -v grep | awk '{print $2}'`
rsync -azq --delete /home/* rsync://localhost:$LOCAL_RSYNC_PORT/home
## Close the ssh tunnel as the it's not needed anymore
kill $SSH_TUNNEL_PID
exit 0