Add new check for empty directories to innobackupex-runner
The /usr/local/bin/innobackupex-runner.sh script on the dbs node
won't run correctly if an empty directory has been left from
a previous run. We need to add additional condition for them.
Closes-Bug: PROD-35625
Change-Id: I558a7465431a096657f4c9d6c7f89eb700d6eae8
diff --git a/xtrabackup/files/innobackupex-client-runner.sh b/xtrabackup/files/innobackupex-client-runner.sh
index 768bd37..89ee0c2 100644
--- a/xtrabackup/files/innobackupex-client-runner.sh
+++ b/xtrabackup/files/innobackupex-client-runner.sh
@@ -145,7 +145,7 @@
mkdir -p $TMPINCRDIR
# Find latest incremental backup.
- LATEST_INCR=$(find $TMPINCRDIR -mindepth 1 -maxdepth 1 -type d | sort -nr | head -1)
+ LATEST_INCR=$(find $TMPINCRDIR -mindepth 1 -maxdepth 1 -type d -not -empty | sort -nr | head -1)
# If this is the first incremental, use the full as base. Otherwise, use the latest incremental as base.
if [ ! $LATEST_INCR ] ; then
@@ -177,7 +177,7 @@
mkdir -p $TMPINCRDIR
# Find latest incremental backup.
- LATEST_INCR=$(find $TMPINCRDIR -mindepth 1 -maxdepth 1 -type d | sort -nr | head -1)
+ LATEST_INCR=$(find $TMPINCRDIR -mindepth 1 -maxdepth 1 -type d -not -empty | sort -nr | head -1)
# If this is the first incremental, use the full as base. Otherwise, use the latest incremental as base.
if [ ! $LATEST_INCR ] ; then