From 8aa13c8e285ad496ed7c8511ae0b735eed73ebd4 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Wed, 18 Mar 2015 10:37:00 +0530 Subject: geo-rep/gverify: Ignore .trashcan while checking slave is empty. With trash translator, '.trashcan' is created in gluster volume during init. So geo-rep create used to fail, with slave not being empty. The gverify script should ignore '.trashcan' while checking whether slave is empty. Change-Id: Ib7ee265c6aa99b63c7ccf103747d47a6f756ad35 BUG: 1203086 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/9921 Reviewed-by: Aravinda VK Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- geo-replication/src/gverify.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh index c5593a39f11..e661267ce50 100755 --- a/geo-replication/src/gverify.sh +++ b/geo-replication/src/gverify.sh @@ -90,7 +90,7 @@ function slave_stats() cd $d; disk_size=$(df -P -B1 $d | tail -1 | awk "{print \$2}"); used_size=$(df -P -B1 $d | tail -1 | awk "{print \$3}"); - no_of_files=$(find $d -maxdepth 0 -empty); + no_of_files=$(find $d -maxdepth 1 -path "$d/.trashcan" -prune -o -path "$d" -o -print0 -quit); umount -l $d; rmdir $d; @@ -179,7 +179,7 @@ function main() ERRORS=$(($ERRORS + 1)); fi - if [ -z $slave_no_of_files ]; then + if [ ! -z $slave_no_of_files ]; then echo "$3::$4 is not empty. Please delete existing files in $3::$4 and retry, or use force to continue without deleting the existing files." >> $log_file; ERRORS=$(($ERRORS + 1)); fi; -- cgit