[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

excluding /*/ and /**/



hi list.

using tarsnap 1.0.39 on archlinux with bash 4.4.19(1)-release.

let's get this part out of the way:

# pwd
/tmp/zzz
# find . | sort
.
./a
./a/aaa
./a/aaa/empty.file
./a/empty.file
./b
./b/bbb
./b/bbb/empty.file
./b/empty.file
./c
./c/ccc
./c/ccc/empty.file
./c/empty.file
./empty.file
--- shortcut to making all of the above ---
# base64 -d > out.tar.xz <<EOF
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4Cf/APpdAD1oB8AbqVfSqwKaHIpf7P58CFBLIsb+UCAu
yApZko3l0bgNLtT/KL0Pma/n89nj9V8xEeUIKwaPTR+vz2oMgzefx5smrH2YwVdW2gfAfRJ1FA2a
iwAfuux6ilri0lVQlFMetwszIoPq6RSheeHmkB/trK1dcfMspTGxSghqH0b9SP/IrRtmx4ofX3B0
Xm1GgV6A4U6LjzXZ9AyuuATDCc8+KOn4O3j51TWdtH2leteKaHg4EzC6ZnDRvvjc9aWKVwRnaT7s
aLBvHwcNayAMp4n1aiXrntTZGNnOjHuyk1D6VJJgx+6Tt3hbLnwRLW0tGIYY4nLVsxUbIgAAAAD2
9NlNzg38+wABlgKAUAAAaOpP87HEZ/sCAAAAAARZWg==
EOF
--- to make sure i did nothing nasty ---
# tar tf out.tar.xz
--- i'll assume out.tar.xz extraction to /tmp ---

now, i want to exclude any empty.file in a first level directory (relative to /tmp/zzz).
# cat /tmp/zzz.excludes
/tmp/zzz/*/empty.file

so i run this
# tarsnap -c --dry-run -v -f test1 -X /tmp/zzz.excludes /tmp/zzz
tarsnap: Removing leading '/' from member names
a tmp/zzz
a tmp/zzz/empty.file
a tmp/zzz/c
a tmp/zzz/b
a tmp/zzz/a
a tmp/zzz/a/aaa
a tmp/zzz/b/bbb
a tmp/zzz/c/ccc

ummm. no. the tmp/zzz/?/???/empty.file (s) should be there?

i thought to do that it would need an exclude like /tmp/zzz/**/empty.file .
also, if * matches anything or *nothing at all*, why does tmp/zzz/empty.file
get grabbed as
# ls -al /tmp/zzz//empty.file 
-rw-r----- 1 root root 0 2018-04-28 08:15 /tmp/zzz//empty.file
would match?

thank-you,
rob (on list)