attic icon indicating copy to clipboard operation
attic copied to clipboard

Allow to ignore file by size

Open cljoly opened this issue 8 years ago • 5 comments

It would be great to be able to ignore file by their size, like this

attic create /somewhere/my-repository.attic::Monday ~/Documents --exclude-by-size '>=15M'

to exclude file superiors to 10Mo.

We can do it now with a combination of --exclude-from and find command, but that force to read everything twice, which can be very long.

cljoly avatar Jul 25 '15 12:07 cljoly

sounds nice. i already had a usecase like follows for such a feature:

imagine a really slow connection between a production server and its (remote) backup-repo server. you are creating the initial backup and you want to backup most files (small, but important, like documents) rather quickly (and skip the big, less important stuff).

So, one would do multiple backup runs with increasing "exclude size" (and finally not exclude by size any more). By doing that, backing up your big unimportant files won't delay you small important files backup.

ThomasWaldmann avatar Jul 25 '15 15:07 ThomasWaldmann

I know this usecase and had it myself before. But implementing this as a feature in attic/forks would be violating the KISS principle IMHO.

Especially as long as you can generate exclude-files with a simple 'find /home/foo -size +1000k' …

I would say it is not needed in attic/forks.

dragetd avatar Nov 17 '15 15:11 dragetd

@dragetd good idea. :)

ThomasWaldmann avatar Nov 17 '15 15:11 ThomasWaldmann

@dragetd @ThomasWaldmann

Using a find command before running attic forces to read the data structure once and then when once again with attic.

It's a problem in my opinion with big set of data in mind.

I understand that KISS principles are an important concern, but performance is a quite important one too.

cljoly avatar Nov 20 '15 16:11 cljoly

Also worth noting that separating listing and processing the files will create a race condition: if you generate an exclusion list, you might backup files that were created in the meantime, but should be excluded based on your criteria. On the other hand, if you generate an inclusion list, you will miss all new files that were created between the listing and processing stage.

n-st avatar Oct 07 '17 12:10 n-st