Andrew Ferguson <adferguson <at> gmail.com> writes: > On Jan 24, 2009, at 1:23 AM, freeslkr wrote: > >> Johannes H. Jensen <joh <at> pseudoberries.com> writes: >> >>> I'm trying to combine --max-file-size and --exclude in the following >>> way to back up everything in /home/joh/tmp/sync1 that's below 128MB: >>> >>> rdiff-backup --max-file-size 134217728 --print-statistics --include >>> '/home/joh/tmp/sync1' --exclude '/*' / /media/Backup/FarSite >>> >>> However rdiff-backup seems to ignore --exclude completely when >>> --max-file-size is specified and tries to backup the whole root >>> filesystem instead! Note that this works perfectly if I omit the >>> --max-file-size argument. >>> >>> Is this the intended behaviour? >> >> I'm not sure what is intended, and I haven't looked at the code, >> but --max-file-size=X behaves like "include files with size less >> than X," which short-circuits on a match. Thus, it works with >> something like >> >> rdiff-backup --exclude **.bak --max-file-size 134217728 >> /home/joh/tmp/sync1 /media/Backup/FarSite >> >> But one is left wanting in many common situations, like yours. It >> would be much more useful if it behaved like "exclude files with >> size greater than X." > > Well, "exclude files with size greater than X" is logically the same > as "include files with size less than or equal to X".
OK ... I suppose that I thought that it was clear that I meant "include" and "exclude" in the context of rdiff-backup. For example, when the option --exclude=xyz is processed on a file named abc, it is not included simply because it doesn't match the argument of the --exclude option. Similary --max-file-size=123 could exclude files larger than 123, but not include files with size less than 123. > The problem is that rdiff-backup's selection logic supports only > include or exlucde (not ignore), and short-circuits. The short- > circuiting makes sense, but what is needed is ignore. With ignore > support, what you want is "ignore files with size less than or equal > to X, exclude files with size greater than X". I'll guess that I'm not understanding what you are saying, but I'll plow ahead and disagree with you anyway. >From the description of the Select class in selection.py: As mentioned above, each test takes the form of a selection function. The selection function takes an rpath, and returns: None - means the test has nothing to say about the related file 0 - the file is excluded by the test 1 - the file is included 2 - the test says the file (must be directory) should be scanned 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 .... _______________________________________________ rdiff-backup-users mailing list at [email protected] http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
