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

Re: Questions on include/exclude, and others.



Hi,

On 08/26/10 23:48, Fudi Lu wrote:
> I am unable to get include/exclude to work the way I want. The problem
> is that exclude always take precedence over include, and I cannot
> include only a few entries in a directory.

Yep.  Tarsnap --include and --exclude are deliberately compatible with
the identical tar options, and those act like shell globs rather than
regular expressions... some things just plain aren't possible with them.

I think the right solution here is to add some new --include-regex and
--exclude-regex options, but I haven't had time to do this yet.

> [...] So how to I
> include a directory, but only include some of its entries?

The best option I can think of is using the nodump file flag and the
--nodump option.

> Also, these 2 commands behaves differently:
> 
> cd test; tarsnap --dry-run --include . -vcf test .
> vs
> tarsnap --dry-run --include test -vcf test test
> 
> The former includes only the "." directory excluding all files under it,
> while the latter includes "test" recursively. Why is it so?

Shell globbing is weird. :-/

> I've another question: Does  deduplication work on an account-wide way?
> ie. if I move a big file from one directory to another, the 2
> directories being in different tarsnap archives, would the file block
> duplication be recognized?

Yes.  By the time bits get to the deduplication code, Tarsnap has pretty
much forgotten where they came from.  You'll see a slight performance penalty
on the first backup you do after moving the file because Tarsnap will need to
re-read it rather than relying on a cached copy, but after reading its way
through the file Tarsnap will figure out that it doesn't need to upload any
of it again.

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid