diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 20:25:31 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 20:25:31 -0500 |
commit | 757e28dde46cb4808d87502276d6cf2e30feb6b6 (patch) | |
tree | 366d53f09872eeb2d8e8d7f1f54827ef94302be8 | |
parent | a306c1e1fa3c7b62059f25522f61629a18d9e79c (diff) | |
download | squashfu-757e28dde46cb4808d87502276d6cf2e30feb6b6.tar.gz |
Convert include/exclude heredocs to simple variables. I'm sure I'll end up changing these to arrays sooner or later
-rwxr-xr-x | squashfu | 19 | ||||
-rw-r--r-- | squashfu.conf | 17 |
2 files changed, 19 insertions, 17 deletions
@@ -78,10 +78,13 @@ create_new_incremental () { return 1; fi - INCLUDES=($(sed -n '/^<<INCLUDES$/,/^INCLUDES$/p' $CONFIG | grep -vE "^<*INCLUDES$")) - EXCLUDES=($(sed -n '/^<<EXCLUDES$/,/^EXCLUDES$/p' $CONFIG | \ - grep -vE "^<*EXCLUDES$" | \ - sed -n 's/\(.*\)/--exclude \1/p')) + # Includes should be pulled in directly from config and not need doctoring + #INCLUDES=($(sed -n '/^<<INCLUDES$/,/^INCLUDES$/p' $CONFIG | grep -vE "^<*INCLUDES$")) + #EXCLUDES=($(sed -n '/^<<EXCLUDES$/,/^EXCLUDES$/p' $CONFIG | \ + # grep -vE "^<*EXCLUDES$" | \ + # sed -n 's/\(.*\)/--exclude \1/p')) + EXCLUDES=$(for excl in $EXCLUDES; do echo --exclude $excl; done) + exit 1 debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT"" /usr/bin/rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT" @@ -316,11 +319,9 @@ action_report () { IFS=$OLDIFS printf "%10s\t%25s\t%7s\n" "" "Incremental Total" "$(du -sh "$BINS_DIR" 2>/dev/null | awk '{print $1}')" - # TODO: Print totals - echo - printf "%10s\t%25s\t%7s\n" "" "$(basename $SEED)" "$(du -h "$SEED" 2>/dev/null | awk '{print $1}')" - echo - printf "%10s\t%25s\t%7s\n" "" "Grand Total" \ + # Print totals (not efficient -- reruns du on things we already ran it on) + printf "\n%10s\t%25s\t%7s\n" "" "$(basename $SEED)" "$(du -h "$SEED" 2>/dev/null | awk '{print $1}')" + printf "\n%10s\t%25s\t%7s\n" "" "Grand Total" \ "$(du -csh "$BINS_DIR" "$SEED" 2>/dev/null | grep -E "total$" | awk '{print $1}')" } diff --git a/squashfu.conf b/squashfu.conf index 9b3affb..27e3b3d 100644 --- a/squashfu.conf +++ b/squashfu.conf @@ -45,19 +45,20 @@ MAX_BINS=10 # not be true incrementals. See 'man rsync' for more info. RSYNC_OPTS=("-Rua" "--delete" "--stats") -# The following defines what will and won't be backed up. The format -# is that of a heredoc. Multiple include and exclude heredocs are NOT -# supported, although this config can be overridden in a separate config -# file with --config or -c.. +# The following defines what will and won't be backed up. The format +# is simply a multi line quoted variable, so you'll need to either single +# quote or escape white spaces and special characters in your paths. -<<INCLUDES +INCLUDES=" /home +/etc /usr /var -INCLUDES +" #end includes -<<EXCLUDES +EXCLUDES=" /lost+found -EXCLUDES +/var/log +" #end excludes |