diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 00:22:07 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 00:22:07 -0500 |
commit | 36a1216f52ba87520414dcc7c2c1919d63cfbfdd (patch) | |
tree | db44cb6f4c6e36faf46d31d6fdae1801d11d7677 | |
parent | c40f0efb8dbcf7a21a48da02f119c29306de4db5 (diff) | |
download | squashfu-36a1216f52ba87520414dcc7c2c1919d63cfbfdd.tar.gz |
EUREKA! Basic backup functionality declared working.
-rwxr-xr-x | squashfu | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -29,14 +29,12 @@ mount_union_with_bins () { # Arguments: numbers of bins to be mounted (variable number) # Returns: 0 on successful mount, non-zero on failure debug "Requested to mount bins: $*" - if [[ -z $1 ]]; then - set "1" - fi + # Mount first as rw, shift, and mount the rest ro branches="br=${BINS_DIR}/$1=rw:"; shift if [[ -n $1 ]]; then for bin in $*; do - branches="${branches}/bins/$bin=ro:" + branches="${branches}${BINS_DIR}/$bin=ro:" done fi branches="${branches}${BKUP_ROOT}/ro=ro" @@ -106,9 +104,6 @@ create_new_bin () { # Update binventory with new bin name and timestamp debug "Updating $BINVENTORY, adding bin $1" echo "${1}:$(date +%s)" >> "$BINVENTORY" - info "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" - cat "$BINVENTORY" - info "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" # If write to bin list fails, remove diretory and exit if [[ $? -ne 0 ]]; then @@ -211,7 +206,7 @@ create_new_incremental () { bin_order=($(sort -n -r -t: -k2 "$BINVENTORY" | cut -d: -f1)) mount_squash - mount_union_with_bins ${BIN_ORDER[@]} + mount_union_with_bins ${bin_order[@]} # Die with error on mount, else start rsync if [[ $? -ne 0 ]]; then |