Ubuntu – ignore files by pattern in deja-dup (Backup)


My Déjà Dup backups have become quiet large and I noticed they contain a huge number of unnecessary files (e.g. *.pyc files, **__pycache__ folders and other build related temporary stuff).

I know that I can ignore specific folders, but is there a way to exclude files and or folders by patterns?

I thought there might be more options usable trough a configuration file, but Déjà Dup doesn't use one. So I looked at duplicity (the CLI it is based on), but the man page doesn't mention a configuration file either. I know that duplicity can ignore files and folders based on patterns (--exclude, --exclude-filelist), but I have no idea how to combine this with Déjà Dup.

Do I have to ditch Déjà Dup and use duplicity manually? Or is there a way to set the needed options, so that they are used automatically, when duplicity is used by Déjà Dup?

Best Answer

  • You can edit the exclude list like:

    gsettings get org.gnome.DejaDup exclude-list
    # remove comment to execute
    # gsettings set org.gnome.DejaDup exclude-list ['path1', 'path2']

    Source: https://answers.launchpad.net/deja-dup/+question/280954

    I tried to add patterns like '**/.git' and '**/build' into that list, like this:

    gsettings get org.gnome.DejaDup exclude-list > exclude-list
    gedit exclude-list
    gsettings set org.gnome.DejaDup exclude-list "`cat exclude-list`"

    But to me it seems like the **'s were not passed to duplicity. So instead I ended up doing seaches like

    locate "/home/*/.svn"
    locate "/home/*/build"

    and added them to the exclude-list manually