# SYNOPSIS
-bup restore [\--outdir=*outdir*] [\--exclude-rx *pattern*] [-v] [-q]
-\<paths...\>
+bup restore [\--outdir=*outdir*] [\--exclude-rx *pattern*]
+[\--exclude-rx-from *filename*] [-v] [-q] \<paths...\>
# DESCRIPTION
* '/foo/.' - exclude the content of any directory named foo
* '^/tmp/.' - exclude root-level /tmp's content, but not /tmp itself
+\--exclude-rx-from=*filename*
+: read --exclude-rx patterns from *filename*, one pattern per-line
+ (may be repeated).
+
\--map-user *old*=*new*
: for every path, restore the *old* (saved) user name as *new*.
Specifying "" for *new* will clear the user. For example
--
C,outdir= change to given outdir before extracting files
numeric-ids restore numeric IDs (user, group, etc.) rather than names
-exclude-rx= skip paths that match the unanchored regular expression
+exclude-rx= skip paths matching the unanchored regex (may be repeated)
+exclude-rx-from= skip --exclude-rx patterns in file (may be repeated)
v,verbose increase log output (can be used more than once)
map-user= given OLD=NEW, restore OLD user as NEW user
map-group= given OLD=NEW, restore OLD group as NEW group
./sub/foo"
+# bup restore --exclude-rx-from ...
+# =================================
+
+WVSTART "restore --exclude-rx-from"
+WVPASS rm -rf src "$BUP_DIR" buprestore.tmp
+WVPASS bup init
+WVPASS mkdir src
+WVPASS touch src/a
+WVPASS touch src/b
+WVPASS mkdir src/sub1
+WVPASS mkdir src/sub2
+WVPASS touch src/sub1/a
+WVPASS touch src/sub2/b
+WVPASS bup index -u src
+WVPASS bup save --strip -n bupdir src
+WVPASS echo "^/sub1/" > exclude-rx-file
+WVPASS bup restore -C buprestore.tmp \
+ --exclude-rx-from exclude-rx-file /bupdir/latest/
+actual="$(WVPASS cd buprestore.tmp; WVPASS find . | WVPASS sort)" || exit $?
+WVPASSEQ "$actual" ".
+./a
+./b
+./sub2
+./sub2/b"
+
WVPASS rm -rf "$tmpdir"