aboutsummaryrefslogtreecommitdiffstats
path: root/squashfu
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-18 11:19:29 -0500
committerDave Reisner <d@falconindy.com>2010-01-18 11:19:29 -0500
commit5570ac4a49b7e674625dd410bb6167dde9011baa (patch)
treeefe50d86aba523ec15bff5f014b31a9b030d1050 /squashfu
parent647eb3ec4c9d35fd7439a45b6ea48fa04d77f484 (diff)
downloadsquashfu-5570ac4a49b7e674625dd410bb6167dde9011baa.tar.gz
Merge create_new_incremental() into action_backup()
Diffstat (limited to 'squashfu')
-rwxr-xr-xsquashfu55
1 files changed, 24 insertions, 31 deletions
diff --git a/squashfu b/squashfu
index 7694c80..8ca2b23 100755
--- a/squashfu
+++ b/squashfu
@@ -67,36 +67,6 @@ create_new_squash () {
sweep_bins
}
-create_new_incremental () {
-# Args: none
-# Returns: 0 on success, non-zero on error
-
- info "Creating new bin"
- # Make a new bin for this incremenetal
- get_next_available_bin
- create_new_bin $?
-
- # Determine the mount order via binventory
- local bin_order=($(sort -n -r -t: -k2 "$BINVENTORY" | cut -d: -f1))
-
- mountpoint "${SQUASH_MOUNT}" &>/dev/null || mount_squash
- mount_union_with_bins ${bin_order[@]}
-
- # Die with error on mount, else start rsync
- if [[ $? -ne 0 ]]; then
- return 1;
- fi
-
- # Includes are pulled in directly from config
- EXCLUDES=$(for excl in ${EXCLUDES[@]}; do echo --exclude $excl; done)
-
- debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT""
- info "Creating new incremental"
- /usr/bin/rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT"
-
- return $?
-}
-
create_new_bin () {
# Arguments: 1, the number of the bin to create
# Returns: 0 on success, non-zero on error
@@ -258,10 +228,33 @@ action_backup () {
# Cleanup union, in case user was doing a rollback and forgot to unmount (or error on last run)
mountpoint "$UNION_MOUNT" &>/dev/null && unmount_union
- create_new_incremental
+ info "Creating new bin"
+ # Make a new bin for this incremenetal
+ get_next_available_bin
+ create_new_bin $?
+
+ # Determine the mount order via binventory
+ local bin_order=($(sort -n -r -t: -k2 "$BINVENTORY" | cut -d: -f1))
+
+ mountpoint "${SQUASH_MOUNT}" &>/dev/null || mount_squash
+ mount_union_with_bins ${bin_order[@]}
+
+ # Die with error on mount, else start rsync
+ if [[ $? -ne 0 ]]; then
+ return 1;
+ fi
+
+ # Includes are pulled in directly from config
+ EXCLUDES=$(for excl in ${EXCLUDES[@]}; do echo --exclude $excl; done)
+
+ debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT""
+ info "Creating new incremental"
+ /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
fi
check_for_resquash