Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Convert include/exclude heredocs to simple variables. I'm sure I'll e…

…nd up changing these to arrays sooner or later
  • Loading branch information...
commit 757e28dde46cb4808d87502276d6cf2e30feb6b6 1 parent a306c1e
@falconindy authored
Showing with 19 additions and 17 deletions.
  1. +10 −9 squashfu
  2. +9 −8 squashfu.conf
View
19 squashfu
@@ -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}')"
}
View
17 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
Please sign in to comment.
Something went wrong with that request. Please try again.