aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-18 11:25:35 -0500
committerDave Reisner <d@falconindy.com>2010-01-18 11:25:35 -0500
commit7710ab2b827374767a518d9f5a3991474dd2fa95 (patch)
tree139582081aee2a1fc60381083fab184b9cd40190
parent5570ac4a49b7e674625dd410bb6167dde9011baa (diff)
downloadsquashfu-7710ab2b827374767a518d9f5a3991474dd2fa95.tar.gz
define new_bin in action_backup so it can be later used to remove the bin if/when required
-rwxr-xr-xsquashfu9
1 files changed, 5 insertions, 4 deletions
diff --git a/squashfu b/squashfu
index 8ca2b23..c6d2f9e 100755
--- a/squashfu
+++ b/squashfu
@@ -231,7 +231,8 @@ action_backup () {
info "Creating new bin"
# Make a new bin for this incremenetal
get_next_available_bin
- create_new_bin $?
+ local new_bin=$?
+ create_new_bin $new_bin
# Determine the mount order via binventory
local bin_order=($(sort -n -r -t: -k2 "$BINVENTORY" | cut -d: -f1))
@@ -252,9 +253,9 @@ action_backup () {
/usr/bin/rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT"
if [[ $? -gt 0 && $DEL_BIN_ON_FAIL == "true" ]]; then
- # Remove the physical bin and edit binlist
- # set next_bin to be local
- # use return val from finding the next bin
+ # rsync failed and user doesn't want the bin kept
+ sed -n "/^$new_bin:[0-9]*/d"
+ rm -rf ${BINS_DIR}/$new_bin
fi
check_for_resquash