I came up with a working workaround for this. The problem seems to be that duplicity does not itself expand wildcards (except for ** apparently) but relies on the shell to do that, and when it is run from deja-dup there is no shell involvement, which is why that now blocks configuring wildcard excludes. Sure, you can use dconf-editor to force them into the saved excludes list, but they don't work (from the monitoring in the script below I actually found that deja-dup would drop excludes containing a '*' and not pass them to duplicity at all).
To make it work we need shell expansion of the wildcards. You can do that manually and insert the results via dconf-editor, as suggested here, but this solution does it automatically at backup run time.
First find where duplicity is on your path ("which duplicity") then find a path location ahead of it in the path ("echo $PATH"). In my case it is /usr/bin/duplicity and /usr/local/bin comes ahead of that, which is perfect. Create a text file named duplicity in that latter path location (e.g. /usr/local/bin/duplicity), make it executable (chmod +x ...) and put this content in there:
#! /bin/bash
# Shim script run from deja-dup in place of duplicity, to add in file/pattern
# exclude arguments for duplicity.
#
# The excludes are read from ~/.config/deja-dup-excludes (one-per-line).
ARGS="$*"
EXCLUDES=$(cat $HOME/.config/deja-dup-excludes | sed -e 's/#.*$//' -e 's/^[ \t]*//' -e '/^$/d')
if ( echo "$ARGS" | grep -q '\--exclude'); then
for EXCL in $EXCLUDES
do
EXCL_ARG=$(find $EXCL -printf '--exclude %p ')
ARGS="$EXCL_ARG$ARGS"
done
fi
#echo "$ARGS" >>/tmp/dup.out
/usr/bin/duplicity $ARGS
Make sure that the last line has the correct path for the real duplicity on your machine, and you can un-comment the echo statement if you want to check your work.
Then create a file .config/deja-dup-excludes under your home directory, with the excludes listed one-per-line, e.g.:
# Exclude files/patterns for deja-dup
# (used by the /usr/local/bin/duplicity script).
/home/Ian/core.*
/etc/postfix/sasl_passwd*
Any lines beginning with a '#' will be taken as comment lines and ignored.
deja-dup will now execute that script instead of the real duplicity, and it will add in the necessary --exclude arguments before calling the latter.
A hack, admittedly, but it works a charm.