rsync with ssh-rsa+authorized_keys
Much like explained in a previous post, one can use a passwordless RSA key to set up a cron job doing an rsync of one's computer on a remote server, via ssh.
The relevant part of the authorized_keys file is (everything in the same line):
command="rsync --server -vlogDtpr . /home/pfortuny/backup/",no-port-forwarding,
no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa .....
Taking into account that the -vlogDtpr depends on the specific options of the rsync command you issue. In my case, the script is simply (right now)
$ cat ./bin/backup.sh
/usr/bin/rsync -av -e "ssh -i /home/pfortuny/.ssh/backup_key" --filter ":
.rsync.dirs" \ ~/ email@example.com:"~/backup/"
The option -av is expanded to -vlogDtpr on the server, ...