I'm just starting with tarsnap, and have it built, installed, and running on my iMac running Mojave, and I've been doing some dry runs to narrow down what I back up. Mostly things are working as I expect, but I've got one case that I haven't figured out a way to do. That's where I want to exclude a directory and its contents *except* for a smattering of files under it. Here's a simplified example.

Say I have:

$  find a -print
a
a/f0
a/b
a/b/f2
a/b/f1

Then:

$ tarsnap --dry-run --no-default-config -c -v a
a a
a a/f0
a a/b
a a/b/f2
a a/b/f1

works as expected. Now, what I really want is to not archive anything in a/b except a/b/f2. I can do that with -T:

$ cat T
a/f0
a/b/f2
$ tarsnap --dry-run --no-default-config -c -v -T T
a a/f0
a a/b/f2

but that means I lose all the directory metadata (if I include the directories, it backups up the directories *and* the files I include explicitly.) I could use nodump, but I'd have to set nodump on hundreds of thousands of files, and I don't know what that would interfere with (for example, one of my local backup methods is Time Machine and I want it to back up some of the files I don't want tarsnap to back up). I've tried include and exclude in .tarsnaprc, but nothing I've tried has worked the way I want. So... any thoughts?

Thanks,
Brian

Reply via email to