rdiff-backup-users
[Top][All Lists]
Advanced

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

Re: [rdiff-backup-users] Re: Combining --max-file-size and --exclude bug


From: Andrew Ferguson
Subject: Re: [rdiff-backup-users] Re: Combining --max-file-size and --exclude bug?
Date: Fri, 30 Jan 2009 17:09:21 -0500

On Jan 30, 2009, at 2:41 AM, freeslkr wrote:
It seems like size_get_sf() should return None for files smaller
than X with --max-file-size=X. It looks like that's what happens
when --exclude doesn't match (though I don't code in python, so
forgive me if I'm wrong). Hmmm, it looks like I should add an item
to my todo list ....


Oh goodness, you're completely correct. I apologize for posting without properly familiarizing myself with the code...


Fortunately, the fix is simple. In selection.py just change lines 534 and 535:

                if min_max: sel_func = lambda rp: (rp.getsize() <= size)
                else: sel_func = lambda rp: (rp.getsize() >= size)

to

                if min_max: sel_func = lambda rp: (rp.getsize() <= size) and 
None
                else: sel_func = lambda rp: (rp.getsize() >= size) and None

(that is, put "and None" at the end)


I think I will put this change in the 1.3.x branch ... do people think this should be a new option? or should we just change the semantics of --max-file-size / --min-file-size ? (I'm leaning towards the latter ...)

While we're talking about this, I noticed that this function doesn't do any special handling for directories... anyone care to comment? I think it would be strange to have rdiff-backup exclude a directory because it had too many or too few files when using these options.


Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]