Fix problem with missing known_hosts
Change-Id: Ic8113c2c24fe22dd44895986a67ede6bd966e90e
Related: PROD-31019
diff --git a/xtrabackup/files/innobackupex-client-runner.sh b/xtrabackup/files/innobackupex-client-runner.sh
index 19a34ba..2da7a53 100644
--- a/xtrabackup/files/innobackupex-client-runner.sh
+++ b/xtrabackup/files/innobackupex-client-runner.sh
@@ -200,7 +200,9 @@
# rsync just the new or modified backup files
if [ ! -z "$SERVERBACKUPHOST" ]; then
echo "Adding ssh-key of remote host to known_hosts"
- ssh-keygen -R $SERVERBACKUPHOST 2>&1 | tee $rsyncLog
+ if [ -f ~/.ssh/known_hosts ]; then
+ ssh-keygen -R $SERVERBACKUPHOST 2>&1 | tee $rsyncLog
+ fi
ssh-keyscan $SERVERBACKUPHOST >> ~/.ssh/known_hosts 2>&1 | tee $rsyncLog
echo "Rsyncing files to remote host"
/usr/bin/rsync -rhtPpv --rsync-path=rsync --progress $BACKUPDIR/* -e ssh xtrabackup@$SERVERBACKUPHOST:$SERVERBACKUPDIR 2>&1 | tee $rsyncLog