From 054051bb76967f6aa60a71bfe8fdaee36f0fb5a9 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 22 Jan 2018 20:01:03 +0000 Subject: [PATCH] MDEV-14150 - backup should fail early if rsync is missing check availability of rsync utility early , when starting backup with --rsync. Fail if it is not there. --- extra/mariabackup/xtrabackup.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 4555744bbea..cbb140d3cdc 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -6165,9 +6165,19 @@ xb_init() return(false); } - if (opt_rsync && xtrabackup_stream_fmt) { - msg("Error: --rsync doesn't work with --stream\n"); - return(false); + if (xtrabackup_backup && opt_rsync) + { + if (xtrabackup_stream_fmt) + { + msg("Error: --rsync doesn't work with --stream\n"); + return(false); + } + bool have_rsync = IF_WIN(false, (system("rsync --version > /dev/null 2>&1") == 0)); + if (!have_rsync) + { + msg("Error: rsync executable not found, cannot run backup with --rsync\n"); + return false; + } } n_mixed_options = 0;