diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 01:25:34 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 01:25:34 -0500 |
commit | 7cf4f20e20eb928ac3a1792e50c0b4d99c39a106 (patch) | |
tree | 4d47a2026188a0b3381d4e43f544691388d44c9a | |
parent | d4d9e8f8b76ebeb5e0c66099b3d0d0ada860cc27 (diff) | |
download | squashfu-7cf4f20e20eb928ac3a1792e50c0b4d99c39a106.tar.gz |
Add more debugging. So much easier to test when aufs doesn't crash every other unmount
-rwxr-xr-x | squashfu | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -5,7 +5,9 @@ source "$CONFIG" # Informational output w/ happy colors debug () { - [[ $DEBUG ]] && echo -e '\033[1;33mDEBUG ::\033[1;m ' $* + if [[ $DEBUG ]]; then + echo -e '\033[1;33mDEBUG ::\033[1;m ' $* + fi } info () { @@ -56,11 +58,13 @@ get_next_available_bin () { sweep_bins () { # Arguments: none # Returns: none + debug "Entering sweep_bins" count=1 # Make sure bins are numbered in order, clean up if not. In other words, # if we have 10 bins, make sure they're ordered 1 through 10. - for bin in "${BINS_DIR}/*"; do + ls "${BINS_DIR}" | while read bin; do + #for bin in "${BINS_DIR}/*"; do if [[ ! -d "${BINS_DIR}/$count" ]]; then high_bin=$(ls "${BINS_DIR}" | sort -n | tail -1) mv "${BINS_DIR}/$high_bin" "${BINS_DIR}/$count" @@ -68,6 +72,8 @@ sweep_bins () { fi count=$[ $count + 1 ] done + debug "Leaving sweep_bins" + ls "$BINS_DIR" } @@ -82,10 +88,11 @@ call_rsync () { sed -n 's/\(.*\)/--exclude "\1"/p')) # rsync source to $BKUP_ROOT/rw - debug "Rsync executing with:" - debug ": Options: ${RSYNC_OPTS[@]}" - debug ": Includes: ${INCLUDES[@]}" - debug ": Excludes: ${EXCLUDES[@]}" +# debug "Rsync executing with:" +# debug ": Options: ${RSYNC_OPTS[@]}" +# debug ": Includes: ${INCLUDES[@]}" +# debug ": Excludes: ${EXCLUDES[@]}" + debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "${BKUP_ROOT}/rw"" rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "${BKUP_ROOT}/rw" return $? } @@ -172,6 +179,8 @@ create_new_squash () { # Determine oldest $1 bins and mount them with the current squash local old_bins=($(sort -n -r -t: -k2 "$BINVENTORY" | tail -$1 | cut -d: -f1)) + debug "old_bins declared as: ${old_bins[@]}" + mount_union_with_bins ${old_bins[@]} # Create new squash with temp name |