[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: backup directory/file exclusion pattern list for borgbackup



On 26.09.21 00:24, Default User wrote:
Hello!

I want to try using borgbackup to do backups of my (only) user directory:
/home/debian-user

I just want to do so using Vorta, a GUI for borgbackup.

But I just need a good, general list of directory and file type
exclusions that I can just cut and paste into the Exclude Patterns
window in Vorta.  Something like the default list of exclusions that
appears by default in the Backintime backup program.

Note 1: borgbackup uses a matching pattern called "Fnmatch" with which
I am not familiar, and don't want to learn by trial and error, losing
data in the process.  Which is why I am looking for a "drop-in" basic
exclude list.

Note 2: I am not intending to use borgbackup to back up the whole
system; just /home/debian-user and its subdirectories.  I am using
timeshift to back up the rest of the system.  Timeshift uses a huge
amount of disk space, but it . . .  works.

Note 3: I am aware that some use backintime to back up user data, and
I have tried it myself.  But it just seems to have some "problems".
For example, the built-in "diff" utility does not seem to do anything.
It seems old and gives the impression of not being heavily developed.
The documentation is "adequate" but mediocre. And what really grinds
my gears about backintime, a problem apparently known as far back as
2014:

"Warning: A recent security audit revealed several possible attack
vectors for EncFs.

From https://defuse.ca/audits/encfs.htm:

EncFS is probably safe as long as the adversary only gets one copy of
the ciphertext and nothing more. EncFS is not safe if the adversary
has the opportunity to see two or more snapshots of the ciphertext at
different times. EncFS attempts to protect files from malicious
modification, but there are serious problems with this feature.

This might be a problem with Back In Time snapshots."

Gee . . .  think so?


The following is an example for what could be in an exclude file for the borg command being used at the CLI with the option:
--exclude-from myExcludeFile

,

# The following items will be excluded from the borg backup
# use absolute paths like in: "borg create repo::archive /home/someUserName"
# do NOT use relative paths like in "borg create repo::archive ."
#
# a slash as the last character excludes all contents but not the dir name itself
# like this the softlinks are preserved


/home/someUserName/.cache/
/home/someUserName/Downloads/
/home/someUserName/TEMP/

/home/someUserName/.julia/artifacts/
/home/someUserName/.julia/compiled/
/home/someUserName/.julia/conda/
/home/someUserName/.julia/packages/
/home/someUserName/.julia/registries/


/home/someUserName/.opt/



You will see that I personally decided to not include in my Backup some quit common folders:
.cache
Downloads
TEMP

You will also see, that I did not exclude a particular single file, only complete directories. You could do so, you could include in teh list particular files, if of interest to you.

I then have some folders to which I install software relevant only to this user, and as this user could anytime reinstall this software, the content of these folders do not contain user data or configuration data of importance, I decided to not fill my backups with the huge and often changing content of these folders:

.opt
.julia/selectionOfReinstallableJuliaFolders

Note that I did not include the complete tree ".julia", because in other sub-directories of Julia there is important user data and configuration data which I do want to become backuped!

I wouldn't know about a general recommendation about folders which by default are recommended for exclusion. You will have to go for the effort and personally decide for your very own situation. If you have an exclusion list which you are happy with from other software, you mentioned backintime, maybe you can learn from my above example about the borg syntax and reuse the exclusions which backintime has configured for you? Note the in my above example there are comment lines included, everything behind the sign "#" is a comment and the comment ends at the end of line. These line can be part of the exclude file and do not harm, they will simply be ignored when borg searches for the entries of to be excluded files or directories. These comments point out some frecuentley parts of particular interest when populating a borg exclusion file. However, nothing beets reading the original documentation.

Good Luck!
Marco


Reply to: