Re: rsyncing via cron
> I would like to backup my computer with rsync regulary with cron to a linux
> server. Both computer are running with debian.
>
> I am using the following script:
>
> #! /bin/sh
> umount /mnt/daten
> rsync -bazv -e ssh --backup-dir=/mnt/data/skeeve/backup_wolber /home/wolber/
> root@192.168.0.2:/mnt/data/skeeve/home
> mount /mnt/daten
>
> The sshkey requires a password but I use ssh-add to activate the key. The key
> is also at the server.
>
> If I am running the script from the shell everything is fine and it saves any
> changes to the server.
>
> If cron is running it by the following line in cronttab:
>
> 18 9 * * 1-5 wolber /usr/local/bin/backup_daten
>
> it generates the following output:
>
> Permission denied, please try again.
> Permission denied, please try again.
> Permission denied (publickey,password,keyboard-interactive).
> rsync: connection unexpectedly closed (0 bytes read so far)
> rsync error: error in rsync protocol data stream (code 12) at io.c(165)
>
> How can I get it to run?
I have never used ssh-add but I am doing the same thing you are
and I used this very nice how-to that you may find useful:
http://killyridols.net/rsyncssh.shtml
-Andy
Reply to: