summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-01-22 20:01:03 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-01-22 20:01:03 +0000
commit054051bb76967f6aa60a71bfe8fdaee36f0fb5a9 (patch)
tree7dfa99679b9cd15540f665d1b01084eef53a8665 /extra
parente30cdb68e54f0908f2a3ac957910c982486b9a44 (diff)
downloadmariadb-git-054051bb76967f6aa60a71bfe8fdaee36f0fb5a9.tar.gz
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.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc16
1 files 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;