Use the rrsync script along with the dedicated ssh key as follows:
REMOTE server
mkdir ~/bin gunzip /usr/share/doc/rsync/scripts/rrsync.gz -c > ~/bin/rrsync chmod +x ~/bin/rrsync
Local computer
ssh-keygen -f ~/.ssh/id_remote_backup -C "Automated remote backup"
REMOTE computer
cat id_remote_backup.pub >> authorized_keys
Prepare the following for the newly added row
command="$HOME/bin/rrsync -ro ~/backups/",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding
To make the result look like
command="$HOME/bin/rrsync -ro ~/backups/",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa AAA...vp Automated remote backup
LOCAL
Put the following script with x resolution in crontab :
#!/bin/sh echo "" echo "" echo "CRON:" `date` set -xv rsync -e "ssh -i $HOME/.ssh/id_remote_backup" -avzP devel@10.10.10.83 :/ /home/user/servidor
Source: http://www.guyrutenberg.com/2014/01/14/restricting-ssh-access-to-rsync/
source share