Skip current sqlite db in backup

When editing a backup Source I can use something like the %MY_DOCUMENTS% to back up the “My Documents” folder of the current user. Are those same variable expansions available in filters?

Specifically, I’m wondering if I can add an “Exclude File” parameter such as --exclude="%dbpath%" to tell Duplicati not to back up the currently in use sqlite file (thus avoiding “file in use” errors when not using VSS).

Yes, environment variable expansions are also done for filters.

That will not work, because %dbpath% is not an environment variable that is set.

Nuts. :cry:

Is there a particular reason why it’s not? (He asked trying to figure out where in the code he code add it…) :wink:

One reason is that I did not think of doing it :smiley:, another reason is that all backups run in the same process, so we would need to ensure that environment variables are removed after the process completes (otherwise we could get the old values in a new run, which would be really bad).

Anyway, the right place to inject and remove environment variables is here:


Unfortunately, the filter strings are already parsed here, so it will not work for filters. I think the filters are created in a few different places and they are currently not tied to a backup, which would be required for dbpath to be known.