Results 1 to 7 of 7

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

  1. #1

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

  2. #2
    dd@home.dk NNTP User

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

    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-opensus...trfs-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/no...er-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

  3. #3

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

    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.

  4. #4

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

    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?

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,857
    Blog Entries
    15

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

    Quote Originally Posted by murznn View Post
    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 immediately 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?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6

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

    Quote Originally Posted by malcolmlewis View Post
    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.

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,857
    Blog Entries
    15

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

    Quote Originally Posted by murznn View Post
    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;
    Code:
    btrfs filesystem show
    btrfs filesystem df /
    snapper list |wc -l
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •