Can't get my rsync to work (rsa) it works interactively but not in cron


This interactively works fine but in a cron it fails with
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.0]

From PRICACC cron.
/usr/bin/rsync -a /home/PRIVACC/

I need to copy pictures from this no privileged account which is associated but I have to protect them against themselves so they don’t fling the privileged account password over the wire.

any clues?
I put it in a file and with the file file path in and it’s also fails with file not found, wth?


You could probably turn off host key checking with the option: -o StrictHostKeyChecking=no

From SO answer:


That’s SSH how do I get the rsync in there?
I guess I could try a scp -r

We will see in about 10 minutes, it’s unfortunate I can’t get the rsync but maybe they will supply a better answer.


Ah, sorry, it looks like one needs to pass the ssh args via the rsync -e option. Something like:

rsync -a -e 'ssh -o StrictHostKeyChecking=no' /home/PRIVACC/



Thanks for answering I’m going to try that.
The scp even gets and error but I don’t think it’s mine :wink:

sh: line 1: No such file or directory


Working like a dream :wink:

Thank you VERY much, I should remember this stuff I’m just old…