diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-18 11:25:35 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-18 11:25:35 -0500 |
commit | 7710ab2b827374767a518d9f5a3991474dd2fa95 (patch) | |
tree | 139582081aee2a1fc60381083fab184b9cd40190 | |
parent | 5570ac4a49b7e674625dd410bb6167dde9011baa (diff) | |
download | squashfu-7710ab2b827374767a518d9f5a3991474dd2fa95.tar.gz |
define new_bin in action_backup so it can be later used to remove the bin if/when required
-rwxr-xr-x | squashfu | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |