The goal is to exclude as much temporary stuff as possible, while still ensuring that what’s backed up allows to restore fully working system from scratch.
From your experience, is there anything else that could be added to exclusions, or maybe there’s anything on the list that it’s better to include into backup?
Hi! I’ve been using the following list, which I adapted from a list I found in this forum years ago. The list could probably be cleaned up a little as a heavy part comes from the original I found, and some software probably changed. But I built upon that and helped me during the years to not backup caches and other non-relevant heavy files.
There is a section for some software I use (or used) that do not follow the Freedesktop.org XDG spec. From time to time I open issues on Github for that software to see if they can honor the spec, which would result in much more predictable backups.
Here is my list, in case can help you:
#
# https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files
#
# ATTENTION: I cannot use $HOME/ here, as the backup is scheduled and run by
# systemd not by user.
#
/home/*/nobackup/*
/home/*/NoBackup/*
/home/*/Videos/kooha/
/home/*/Downloads/*
/home/*/VirtualBox\ VMs/
/home/*/Dropbox/*
/home/*/rclone/
/home/*/tmp*
/home/*/.ecryptfs
/home/*/.Private
/home/*/.cache
/home/*/.gvfs
/home/*/.local/share/gvfs-metadata
/home/*/.dbus
/home/*/.Trash
/home/*/.local/share/Trash
/home/*/.cddb
/home/*/.aptitude
/home/*/.cpan
# Flatpak (WON'T FIX: follow XDG spec) - https://github.com/flatpak/flatpak.github.io/issues/191
/home/*/.var/**/cache/
# SNAP
/home/*/snap/
# Docker images
/home/*/.local/share/docker/
##################################################
# Apps not following the Freedesktop XDG basedir #
##################################################
# Joplin notes
/home/*/.local/share/joplin/
# JetBrains-toolbox installed IDEs
/home/*/.local/share/JetBrains/
# TSK - The Scripting Kit (Standalone Scala scripts)
/home/*/.tsk/
# No longer necessary, I switched to tealdeer which honors Freedesktop basedir
/home/*/.tldrc/
# https://github.com/vercel/pkg/issues/1225
/home/*/.pkg-cache/
#################################################
# Apps placing heavy stuff in unexpected places #
#################################################
# 2021: A bunch of heavy JARs :-/
/home/*/.config/JetBrains/**/sonarlint/plugins
# 2021 VSCode: Contains heavy cache dirs. Preferences shoud be synced on cloud
/home/*/.config/Code/
/home/*/.vscode/extensions/
# 2021 Firefox: Waiting some day they switch to XDG spec https://bugzilla.mozilla.org/show_bug.cgi?id=259356
/home/*/.mozilla/firefox/*/extensions/
/home/*/.mozilla/firefox/*/favicons.sqlite
# 2023 Coc (VIM plugin)
/home/*/.config/coc/extensions/
#########################
# Programming languages #
#########################
/home/*/.sdkman/
# IntelliJ downloaded JDKs
/home/*/.jdks
# Maven
/home/*/.m2/repository
target/*
# Ivy2
/home/*/.ivy2
# Gradle build
build/*
# Scala stuff
# Coursier cache (Scala fetch libraries)
/home/*/.coursier/cache
/home/*/.sbt
# Haskell
/home/*/.stack
# NodeJS stuff
# Node Package Manager cache
/home/*/.npm
# Dependency directories
node_modules/*
jspm_packages/*
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/*
# Eclipse
/home/*/.eclipse
/home/*/workspace/.metadata
# Python virtual env
/home/*/.venv-py3
###############################################
# Directories, probably not worth a backup #
# (uncomment the files you don't need) #
###############################################
/home/*/.android
/home/*/.IntelliJIdea*
/home/*/.AndroidStudio*
/home/*/Android/Sdk
/home/*/.gradle
#/home/*/.gvm
#/home/*/.grails/
#/home/*/.grails_history
#/home/*/.kde/share/apps/nepomuk
#/home/*/.local/share/notbit
#/home/*/.local/libvirt
#/home/*/.vagrant
#/home/*/.vagrant.d
/home/*/.wine
#/home/*/.twister
#/home/*/twister
#*Popcorntime*
#/Scribus
#/VirtualBox*
## Add Game Folders here:
#/games
#/home/*/.local/share/Steam
#/home/*/.steam
#Steam
#/home/*/.minecraft
#/home/*/.PlayOnLinux
# Adobe and Flash
/home/*/.adobe
/home/*/.macromedia
# Files
/home/*/.xsession-errors
/home/*/.recently-used
/home/*/.recently-used.xbel
/home/*/.thumbnails
/home/*/.Xauthority
/home/*/.ICEauthority
/home/*/.gksu.lock
/home/*/.pulse
/home/*/.pulse-cookie
/home/*/.esd_auth
# Thunderbird Cache in your profile folder
/home/*/.thunderbird
/home/*/.thunderbird/*/Cache
# KDE specific
/home/*/.kde/share/apps/RecentDocuments
/home/*/.kde/share/apps/klipper
/home/*/.kde/share/apps/okular/docdata
/home/*/.kde/share/apps/gwenview/recentfolders
/home/*/.kde/share/apps/kmess/displaypics
/home/*/.kde/share/apps/kmess/customemoticons
# Firefox
/home/*/.mozilla/firefox/*/storage
/home/*/.mozilla/firefox/*/Cache
# in case Fx crashes dumps will be stored in this
/home/*/.mozilla/firefox/*/minidumps
# session-specific
/home/*/.mozilla/firefox/*/.parentlock
# phishing database, recreated
/home/*/.mozilla/firefox/*/urlclassifier3.sqlite
# blacklisted extensions
/home/*/.mozilla/firefox/*/blocklist.xml
# extension database, recreated on startup
/home/*/.mozilla/firefox/*/extensions.sqlite
/home/*/.mozilla/firefox/*/extensions.sqlite-journal
/home/*/.mozilla/firefox/*/extensions.rdf
/home/*/.mozilla/firefox/*/extensions.ini
/home/*/.mozilla/firefox/*/extensions.cache
# cached UI data, recreated
/home/*/.mozilla/firefox/*/XUL.mfasl
/home/*/.mozilla/firefox/*/XPC.mfasl
/home/*/.mozilla/firefox/*/xpti.dat
/home/*/.mozilla/firefox/*/compreg.dat
# cached plugin data, recreated
/home/*/.mozilla/firefox/*/pluginreg.dat
# Opera
/home/*/.opera/temporary_downloads
/home/*/.opera/cache
/home/*/.opera/thumbnails
/home/*/.opera/opcache
/home/*/.opera/icons
/home/*/.opera/application_cache
/home/*/.opera/widgets/*/cache
/home/*/.opera/lock
# GnuPG
/home/*/.gnupg/rnd
/home/*/.gnupg/random_seed
/home/*/.gnupg/.#*
/home/*/.gnupg/*.lock
/home/*/.gnupg/gpg-agent-info-*
# Chromium
/home/*/.config/chromium/Default/Local Storage
/home/*/.config/chromium/Default/Session Storage
/home/*/.config/chromium/Default/Application Cache
/home/*/.config/chromium/Default/Archived History
/home/*/.config/chromium/Default/History
/home/*/.config/chromium/Default/Favicons
# Electron apps seem to do this
/home/*/.config/**/Cache
/home/*/.config/**/GPUCache
/home/*/.config/**/ShaderCache
# Indexer
/home/*/.local/share/baloo
/home/*/.local/share/zeitgeist
/home/*/.local/share/akonadi
# Misc
# pidgin
/home/*/.pulse/icons
/home/*/.java/deployment/cache
/home/*/.icedteaplugin
/home/*/.icedtea
/home/*/.gnome2/epiphany/favicon_cache
# to avoid problems, let Dropbox re-create these
/home/*/.dropbox
/home/*/.dropbox-dist