use duply as a backend for dup
As a suggestion, having a profile = <string>
that would run duply with <string> as it's first args
duply already does a very hard and good job about wrapping duplicity in a set of profiles.
Moreover [duply](http://duply.net/) is packaged and maintained.
Side note: using bash (or something else than posix sh) for backupninja would most probably help.
IHMO: working with sh scripting is painful for not so much gain.