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.
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 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.