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

Re: backup directory/file exclusion pattern list for borgbackup



On Tue, Sep 28, 2021 at 1:54 AM deloptes <emanoil.kotsev@deloptes.org> wrote:
>
> 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.
> >
>
> I use this. For file type I do not know
>
> borg create --progress --stats --compression zstd,10 \
>         -e 'pp:/sys' \
>         -e 'pp:/proc' \
>         -e 'pp:/dev' \
>         -e 'pp:/run' \
>         -e 'pp:/tmp' \
>         -e 'pp:/var/tmp' \
>         -e 'pp:/var/log'
>

-------------------------------------------

Hi!

Just an update.

Here is what I came up with, cobbled together, from a number of sources:
*~
*.backup*
**/.cache
/boot/*
/BORG/*
/BORG/.?*
/dev
/dev/*
/dev/.?*
/etc/mtab
/home/*/.cache/
#  /home/*/.cache/chromium/*
/home/*/.cache/mozilla/*
/home/*/.cache/mozilla/firefox/*
#  /home/*/.claws-mail/tmp/*
/home/*/.gvfs
/home/*/.gvfs/*
/home/*/.gvfs/.?*
#  /home/*/.googleearth/Cache/*
/home/*/.opt/
/home/*/.thumbnails/*
/lost+found
/lost+found/*
/lost+found/.?*
/media
/media/*
/mnt
/mnt/*
/proc
/proc/*
/root/.gvfs/*
/root/.gvfs/.?*
/run
/run/*
/sys
/sys/*
/tmp
/tmp/*
/usr/tmp/*
/var/backups/*
/var/cache/*
/var/cache/apt/archives/*.deb
/var/lib/dhcpcd/*
/var/tmp/*
~/.adobe/Flash_Player/AssetCache
~/.cache
~/.ccache
~/.gvfs
#  ~/.local/share/Steam
~/.Private
~/.recent-applications.xbel
~/.recently-used.xbel
#  ~/snap/*/*/.cache
#  ~/.steam/root
~/.thumbnails
~/.var/app/*/cache
~/.xsession-errors
.cache
.cache/*
#  .dropbox*
.gvfs
lost+found/*
.Private
.thumbnails*

This is saved as a text file, which can be altered as needed at any
time, and is copied and pasted into the Exclude Patterns window under
the Sources tab of Vorta.  I want to use Vorta, at least for now,
because it is much more user-friendly  than raw borgbackup.

Note that some of the entries are commented out, as they are not
needed currently, but are there to be uncommented as needed.

Also, there are probably more entries than are really necessary.  I
hope to improve the exclude list over time.

Also note that there are directory entries that probably do not apply
to my immediate use case (backing up user stuff, from
/home/debian-user on down).  For example:
/dev
/dev/*
/dev/.?*
/media
/media/*
/mnt
/mnt/*
/proc
/proc/*
/run
/run/*
/sys
/sys/*
/tmp
/tmp/*
/usr/tmp/*

And some things I just don't know if I need to back them up or not.  Examples:

/BORG/*
/BORG/.?*
/etc/mtab
/home/*/.opt/
/lost+found
/lost+found/*
/lost+found/.?*
lost+found/*
.Private
~/.xsession-errors

Further, the Archlinux wiki rsync article states:
"If GVFS is installed [it is!], /home/*/.gvfs must be excluded to
prevent rsync errors."  Thus, these are on the exclude list:
/home/*/.gvfs
/home/*/.gvfs/*
/home/*/.gvfs/.?*
/root/.gvfs/*
/root/.gvfs/.?*
~/.gvfs
.gvfs

And . . .  I make a special point of excluding:
/media
/media/*
/mnt
/mnt/*

Why?

Because long ago, when I was just learning to use rsync, I tried to
use it to do a full-system backup.  Since nobody told me that /mnt and
/media had to be specifically excluded, rsync did exactly what it was
told to do, recursively backing up everything, filling up an entire
1Tb hard drive, stopping only when it ran out of room!

I do not ever want that to happen again.

Fun fact:
I can use the same exclude list to mirror the same user stuff to a
different backup directory, with obsessive frequency, using rsync:

sudo rsync -avHx --delete --stats --exclude-from
"/home/debian-user/rsync_exclude_list.txt" /home
/media/debian-user/backup_drive/backups_of_host_home_directory_only

Finally, it has been suggested that I could do full system backups
using borgbackup, and doing full system restores, if needed, using
borgbackup from a live SystemRescue cd/usb.
I may try that in the future, as I learn more about borg. It is
complicated, or at least
complex!  But for now I feel secure knowing that I can restore my system
(non-data stuff) at any time, using Timeshift. And 1+ here also, for
SystemRescue.

Well, I don't know if any of this was helpful or even interesting.
But here it is, FWIW.

Thanks for the replies!


Reply to: