garethgeorge/backrest

Optional --exclude-caches

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.

I wanted my backup to include some files in the Firefox cache folder (~/.cache/mozilla/firefox). I added a specific "exclamation-mark" don't-ignore rule for it in an excludes file, and it was confusing why the folder was still missing from the backup.

Then I noticed that the backup command included --exclude-caches.

Describe the solution you'd like

A checkbox option (on by default) for the --exclude-caches flag, to be able to opt out.

I apologize, my mistake. The problem was that my exclude rules didn't work as I expected.

I thought that --exclude-caches is a general list of usual cache patterns.

Reading the docs I see now that --exclude-caches excludes the content of folders where the user (or the app) has added the CACHEDIR.TAG file.

It seems that a checkbox to opt out of the flag is not necessary, since the user has to create the CACHEDIR.TAG file in the first place.

Describing what I tried for someone's future benefit:

I used the "Backup Flags" option to specify an excludes file.

--exclude-file=/home/gambhiro/.../excludes.txt

Which included:

/home/gambhiro/.cache/*
!/home/gambhiro/.cache/mozilla/firefox/2tscc0rg.gambhiro/

This didn't work as I expected, ~/.cache/mozilla was still ignored.

The following works to exclude all of ~/.cache/* except one Firefox profile cache.

# Ignore caches, except mozilla
/home/gambhiro/.cache/*
!/home/gambhiro/.cache/mozilla/

# Keep only Firefox
/home/gambhiro/.cache/mozilla/*
!/home/gambhiro/.cache/mozilla/firefox/

# Keep only a specific Firefox profile
/home/gambhiro/.cache/mozilla/firefox/*
!/home/gambhiro/.cache/mozilla/firefox/2tscc0rg.gambhiro/