0

The following script sits in cron.daily and succeeds when called with run-parts but exits with code 1 when called with anacron -f on Ubuntu 20.04 LTS. I have had many problems with various versions of this script over the years, it seems to stop working every few months. The script is

#!/bin/sh
#
# MAKE SURE HAVE CORRECT REMOTE/AT-HOME LOGIN SETUP AND THAT TARGET IS TOTEMDOC and source is Documents
#
rsync -azvv -e "ssh -o CheckHostIP=no  -i /home/stefan/.ssh/id_rsa" /home/stefan/Documents/ totem@MouseHouse:/totembackup/totemdoc

I used to have problems with path, but I thought the quote marks fixed that. I am at a loss for why it doesn't work anymore.

1 Answers1

0

I managed to work out what was wrong. Upon running run-parts cron.daily as root, I got one of those "The authenticity of host ***** can't be established" messages from ssh. What must have been happening is that this prompt was coming up, timing out, and then the whole script was failing. After saying "yes" manually to the prompt, the script now runs automatically correctly.