[Devel] [PATCH] Detect rsync failure

Nick Andrew nick at nick-andrew.net
Tue Dec 2 21:10:47 PST 2008


It is necessary to detect failure of the rsync command, but the exit
status of the pipeline is the exit status of the last command, by
default. So make it a single command.

Signed-off-by: Nick Andrew <nick at nick-andrew.net>
---
 bin/vzmigrate.in |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/bin/vzmigrate.in b/bin/vzmigrate.in
index 2b29797..31203b5 100755
--- a/bin/vzmigrate.in
+++ b/bin/vzmigrate.in
@@ -439,8 +439,7 @@ fi
 
 log 1 "Syncing private"
 if ! $RSYNC --progress \
-		"$VE_PRIVATE" "root@$host:${VE_PRIVATE%/*}" |
-		grep "% of" | awk -v ORS="\r" '{print $10}'; then
+		"$VE_PRIVATE" "root@$host:${VE_PRIVATE%/*}" ; then
 	log 0 "Failed to sync container private areas"
 	undo_quota_on
 	exit $MIG_ERR_COPY
-- 
1.5.6.5




More information about the Devel mailing list