\--exclude-caches
-: exclude all directories that contain a file CACHEDIR.TAG, whose
- content begins with "Signature: 8a477f597d28d172789f06886806bc55".
+: exclude the contents of all directories that contain a file CACHEDIR.TAG,
+ whose content begins with "Signature: 8a477f597d28d172789f06886806bc55",
+ except for the directory and the tag file itself.
For more information on cachedir-tagging, see
http://www.brynosaurus.com/cachedir/
exclude-from= skip --exclude paths in file (may be repeated)
exclude-rx= skip paths matching the unanchored regex (may be repeated)
exclude-rx-from= skip --exclude-rx patterns in file (may be repeated)
-exclude-caches exclude directories containing a CACHEDIR.TAG
+exclude-caches exclude directories containing a CACHEDIR.TAG, except for the tag file itself
v,verbose increase log output (can be used more than once)
x,xdev,one-file-system don't cross filesystem boundaries
"""
if exclude_caches:
tag_filename = 'CACHEDIR.TAG'
tag_contents = 'Signature: 8a477f597d28d172789f06886806bc55'
- if os.path.exists(prepend+name+tag_filename):
- f = open(prepend+name+tag_filename, 'rb')
+ tag_path = path+tag_filename
+ if os.path.exists(tag_path):
+ f = open(tag_path, 'rb')
try:
data = f.read(len(tag_contents))
finally:
f.close()
if data == tag_contents:
debug1('Skipping %r: excluding cache dir' % (prepend+name))
+ try:
+ st = xstat.lstat(tag_path)
+ except OSError, e:
+ add_error(Exception('%s: %s' % (realpath(tag_path), str(e))))
+ # CACHEDIR.TAG matched -> only backup the tagfile and the dir-node itself
+ yield (tag_path, st)
+ yield (path, pst)
continue
if bup_dir != None:
if os.path.normpath(path) == bup_dir:
WVPASS touch $D/a
WVPASS bup random 128k >$D/b
WVPASS mkdir $D/d $D/d/e
+ WVPASS touch $D/d/file
WVPASS bup random 512 >$D/f
WVPASS echo 'Signature: 8a477f597d28d172789f06886806bc55' > $D/d/CACHEDIR.TAG
WVPASS bup index -ux --exclude-caches $D
WVPASS bup save -n exclude $D
WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
b
+d
f"
+ WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/d/)" "CACHEDIR.TAG"
) || WVFAIL