Ubuntu – What files and directories can be excluded from a backup of the home directory


Duplicity does already a great job of making efficient backups, but I want still to minimize the amount of files being back-upped.

What files or directories can be excluded in a home directory? Please name these explicitly, wildcards allowed, paths are relative to the home directory.

Best Answer

Most of these files and directories are recreated if missing. They are mostly intended for lowering the startup time of an application (Firefox extensions cache), indicating locks (.gksu.lock), or containing session-specific information (e.g. ID of dbus session). Recent documents changes frequently and is generally not that sensible to backup.

These directories may be excluded:

.gvfs                           # contains mounted file systems?
.Private                        # contains the actual encrypted home directory
.dbus                           # session-specific
.Trash                          # do I need to say more?
.cddb                           # cached info about audio CDs
.aptitude                       # cached packages lists


.adobe        # Cache for flash, maybe others?
.macromedia   # except for Flash persistence, there is no reason to keep this


.xsession-errors            # contains errors from the current graphical session
.recently-used              # recently used files
.Xauthority                 # session-specific
.pulse                      # directory

KDE specific:

.kde/share/apps/RecentDocuments # Recent documents on KDE
.kde/share/apps/klipper         # Contains a history of the Klipper clipboard (KDE)
.kde/share/apps/okular/docdata  # you will loose saved scrolling positions of PDFs
.kde/share/apps/kmess/displaypics  # cached other users' profile pics
.kde/share/apps/kmess/customemoticons  # cached emoticons of others

Firefox-specific (see also Profile folder):

.mozilla/firefox/*/minidumps    # in case Fx crashes dumps will be stored in this
.mozilla/firefox/*/.parentlock       # session-specific           
.mozilla/firefox/*/urlclassifier3.sqlite  # phishing database, recreated
.mozilla/firefox/*/blocklist.xml   # blacklisted extensions
.mozilla/firefox/*/extensions.sqlite  # extension database, recreated on startup
.mozilla/firefox/*/XUL.mfasl     # cached UI data, recreated

Opera-specific (related question on Superuser.com: Is documentation available on files and directories in the Opera profile folder?):


Komodo Edit:

.komodoedit/*/XRE/.activatestate/komodo edit/Crash Reports
.komodoedit/*/XRE/.activatestate/komodo edit/*/Cache
.komodoedit/*/XRE/.activatestate/komodo edit/*/minidump



Google Chrome:

.config/google-chrome/Default/Local Storage
.config/google-chrome/Default/Session Storage
.config/google-chrome/Default/Application Cache
.config/google-chrome/Default/History Index *

Other apps:

.pulse/icons                  # Pidgin
.java/deployment/cache        # Cached applets
.dropbox                      # to avoid problems, let Dropbox re-create these
Related Question