Snapper: possible to exclude files/directories? (or: what is /etc/snapper/filters)

As the title asks, is it possible to exclude specific files or directories from being included in snapper snapshots? Specifically I want to exclude some cache directories that will likely have a lot of churn and thus increase the space needed for snapshots significantly.

I know I could create btrfs subvolumes, is that perhaps the preferred way to do this, even though that would only work for directories, not files?

I notice that /etc/snapper/filters exist, and perhaps files in that directory do precisely this? I have however not been able to find any documentation for it. The man page merely mentions that ‘filters’ exist without explaining what they actually are.

On 07/13/2012 06:36 PM, Quantumboredom wrote:
> I have however not been able to find any
> documentation for it.

this page
https://www.google.com/search?q=linux+snapper+filter

leads to lots of info…second on that page here is
http://kuther.net/blog/using-opensuses-snapper-archlinux-manage-btrfs-snapshots

which says: “To exclude everything in /var/log/, create the file
/etc/snapper/filters/logfiles.txt” but i’m not sure if that is what you
need, or where he got his info…

i don’t know, maybe he got it from here:
http://www.novell.com/communities/node/13640/introduction-system-rollbacks-btrfs-and-snapper-sles-11-sp2

i can’t say because i’m not very familiar with btrfs…(i won’t trust my
system/data to it until it has better fixin’ tools)


dd

I just tested it by creating a custom filter and taking snapshots while modifying a filtered file. It seems like the filter is only for the output of e.g. snapper status xx…yy and so on. The files matched by the filters are still included in the snapshots.

That probably means that the only way to exclude something is by creating a btrfs subvolume.

Is there any news about this problem? Maybe exist some other way to exclude some files or folders from btrfs snapshot via Snapper?

As I understand, it is not too hard to implement, because btrfs snapshots are not readonly and after creating snapshots we can remove specified folders and files from snapshot.
So this can be solved via adding script that run immediatly after snapshot is created and removes unnecessary files from it. What do you think about this?

Hi
For specific folders, then create a sub volume so it’s excluded (that might need re-thinking when boot-able snapshots arise), else why really spend time deleting meta data of files? I just maintain a minimal config of timeline and numbered snapshots so they don’t take up space…

Maybe some examples of your situation where it’s needed?

In my computer .cache folder have many files that changes every time, for example at now it have size - 4.6 GB
Also Firefox and Chrome browser folders contains history databases that changes every time too.
Will be good to exclude them from the snapshot.

Hi
I exclude /home from snapshots… as in @/home is a sub volume. You can then as your user create your own snapshots as required via snapper.

When you say 4.6GB is that from a normal df command? If so, what about;


btrfs filesystem show
btrfs filesystem df /
snapper list |wc -l