If the ssh key is password protected, you can't use it in this scenario,
because there is noone entering the password. ;-)
Of course, this is clear, I thought you know something like 'rsync does not accept passphrase-less keys' when I asked for the relevance. My key is WITHOUT passphrase (allthough there would actually be ways to pass one to ssh without a roboter sitting in front of the pc, eg sshpass)
Could you please use the COMPLETE path for rsync and retry?
To be honest, my script never reached the point where rsync is invoked. The best is to show you a part of the code (the variable identifiers are self-explaining, I think):
test -d "$SRC_BASEPATH" || xc=51
test -r "$SRC_BASEPATH" || xc=52
test "`ssh -f $DST_LOGIN_SSH_USER@$DST_HOST "test -d '$dstBasePath' && echo true"`" == true || xc=53
test "`ssh -f $DST_LOGIN_SSH_USER@$DST_HOST "test -w '$dstBasePath' && echo true"`" == true || xc=54
if (( xc > 0 )); then
do_log "$errlog" "$errmail" $xc
The test -d '$dstBasePath'
check passed ok, but test -w '$dstBasePath'
(== eXitCode) to value 54, which then makes the script to log an error and send me an e-mail with an appropriate error message. Then it exits.
In the meantime, I added the following lines to the script for some more testing (please note the fully qualified filename of the executable :) )
/usr/bin/ssh $DST_LOGIN_SSH_USER@$DST_HOST "test -d '$dstBasePath' && echo true" >>$LOG_FILE
/usr/bin/ssh $DST_LOGIN_SSH_USER@$DST_HOST "echo '$dstBasePath'" >>$LOG_FILE
/usr/bin/ssh $DST_LOGIN_SSH_USER@$DST_HOST "test -w '$dstBasePath' && echo true || echo false" >>$LOG_FILE
And it's crazy:
If cron starts the script, I get no output written into $LOG_FILE, if I start it on the cmdline, I gettrue
as one would expect it.
If somebody can help with this, I would highly appreciate it, but I now think it is rather a cron than a Buffalo NAS thing.