Re: Running from script - quotes being ignored?
Kenneth Loafman via Duplicity-talk <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.duplicity.general |
|---|---|
| Message-ID | <CAD-_Ma0iL92NC_kutRDk8Q+MbtRrKjfAyjpod4-0zRoLTtGAhQ@mail.gmail.com> |
Looks good to me as well. You might try using backslash to make the single quotes protected. I've never run it that way with pipx. Any reason not to just install it? ...Thanks, ...Ken On Tue, Jul 8, 2025 at 3:06 PM Andy Hairston via Duplicity-talk < [email protected]> wrote: > I'm sure this is more of a bash scripting issue, but I'm pretty well > stuck. I've been running duplicity via bash scripts for several years, and > went to add an option to specify compression level - and now the script > won't work. Here's the script, minus some private items (and boiled down to > just what is needed to reproduce the issue): > > export B2BUCKET=[snip] > export DUPLICITY_CMD="pipx run duplicity" > BACKUP_COMMAND="$DUPLICITY_CMD backup --gpg-options='--compress-algo=bzip2 > --bzip2-compress-level=9'" > echo -E $BACKUP_COMMAND /home/[snip] ${B2BUCKET} > $BACKUP_COMMAND /home/[snip] ${B2BUCKET} > > If I run this, I get: > pipx run duplicity backup --gpg-options='--compress-algo=bzip2 > --bzip2-compress-level=9' /home/[snip] [snip] > CommandLineError: Wrong number of positional args for 'backup', got 3 > Expected 2 positionals from ["--bzip2-compress-level=9'", '/home/[snip]', > '[snip]']. > Enter 'duplicity --help' for help screen. > > But if I copy the outputted line "pipx run duplicity ...", paste it into > the command line, and run it, it runs fine. It's almost like the > single-quotes around the gpg-options are being ignored, passing only the > --compress-algo=bzip2 argument to gpg-options, and saving the > bzip2-compress-level option for duplicity's backup command. > > I know I could put the entire thing on one line, but I had split it into > command and arguments due to running multiple commands (remove-older-than, > for instance). This works, and is my temporary workaround: > $DUPLICITY_CMD backup --gpg-options='--compress-algo=bzip2 > --bzip2-compress-level=9' /home/[snip] ${B2BUCKET} > > Any idea what I'm doing wrong in my export commands, causing the quotes to > be ignored? > -- > > Andy Hairston > _______________________________________________ > Duplicity-talk mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/duplicity-talk > _______________________________________________ Duplicity-talk mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/duplicity-talk