crontab + rsync problem

Andrew Glen-Young aglenyoung at gmail.com
Thu Oct 11 09:53:06 UTC 2007


On 11/10/2007, Luca Ferrari <fluca1978 at infinito.it> wrote:
[...]
> rsync --server --sender -vvvvblogDtprcxz --bwlimit=32 --backup-dir /vol2/camera_oscura . /vol2/samba/camera_oscura/specifiche
> Permission denied, please try again.
> Permission denied, please try again.
> Permission denied (publickey,password,keyboard-interactive).
> rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
> _exit_cleanup(code=12, file=io.c, line=453): entered
> rsync error: unexplained error (code 255) at io.c(453) [receiver=2.6.9]
> _exit_cleanup(code=12, file=io.c, line=453): about to call exit(255)
>
> So all the commands are executed right, but it seems that the host cannot
> connect to the remote thru ssh. Now, in my .bash_profile I've got:
>
> eval `ssh-agent`
> ssh-add $HOME/.ssh/id-dsa
>
> that adds the rsa key for the authentication of the user to the remote host. I
> guess the problem is about this point, since the error messages remind me an
> ssh error. However I cannot understand why it works interactively and not
> thru crontab.
>
> Any idea?
>

It looks like SSH auth is failing as you thought.

Bash will not use your '.bash_profile' for non-interactive shells by
default. There are easy ways around this, but I would suggest that you
rather embed the commands into your script or use a helper like
'keychain' and then source it's file from your script.

Read the 'INVOCATION' section of bash(1) for more details.

- A.




More information about the ubuntu-users mailing list