[Box Backup] Include/Exclude features

Ben Summers boxbackup@fluffy.co.uk
Wed, 15 Dec 2004 20:04:50 +0000


On 14 Dec 2004, at 18:21, Joe Krahn wrote:

> It may be useful to have more options for include/exclude, for example 
> file size limits.
>
> A more complex example is to not backup files that are known unchanged 
> from a distribution package. For an RPM based system, one could backup 
> a list of installed RPMS, run rpm --verify, and exclude all unchanged 
> package files.
>
> This could easily be handled by allowing the exclude directive to 
> specify a filename containing a list of filenames.
>
> An alternative to providing more complex selections would be to have 
> an external executable/script do the directory recursion, and supply 
> the entire list of files/dirs (i.e. plain old find would provide a lot 
> of options). But, it's not as simple as I had thought, because 
> SyncDirectory is interleaved with UpdateItems.
>
> So, for now, I would suggest:
>
> [Exclude|AlwaysInclude][File|Dir][|sRegex][|From]
>
> where the From suffix means read filenames from the specified file(s).

This would result in a lot more code paths which will have to be 
tested. If there is a compelling need for this kind of thing, then my 
preferred solution would be to implement a feature where an external 
program is used for checking what is to be backed up. This can also 
gather extra statistics on the behaviour of the backup system, should 
that be required.

However, it's not a high priority item at the moment.

>
> I suspect that a really big file list will result in a lot of overhead,
> but performance is not as important as reliability for now.

The code is written for simplicity of coding, and hence reliability, 
and if performance is a problem then it can be recoded. (As has 
happened for large directory structures.)

>
> A few more things:
>
> I would change the ExcludeFile class to FileSelection class, or 
> similar, since it is also used for Include lists.

I used to only have file exclusions, hence the naming. I should change 
it, I know.

>
> I assume that STRUCTURE_PATCKING_FOR_WIRE_USE_HEADERS is a typo and is 
> supposed to be STRUCTURE_PATCHING_FOR_WIRE_USE_HEADERS. (It's uniform, 
> so I assume a global search-replace...)

And my spelling isn't the best in the world. Fortunately computers 
don't mind as long as you are consistent.

Ben