duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] SSH backend and shell escaping


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] SSH backend and shell escaping
Date: Tue, 9 Dec 2014 15:25:39 -0600

I ran the script above except made the last line 'echo duplicity ...'

duplicity --archive-dir /backup --ssh-options="-oIdentityFile=/root/.ssh/id_backup" --name test --encrypt-sign-key ABCDEF12 /tmp sftp://address@hidden/backup-test

How about running this with 'duplicity ... &> duplicity.log' and attaching duplicity.log to the reply.  That would help a lot.

...Thanks,
...Ken

On Tue, Dec 9, 2014 at 3:03 PM, Yves Goergen <address@hidden> wrote:
I have a problem with shell escaping now. There's too many quotes somewhere and I don't know who doesn't do it right. Here's the essence of my backup script. Some of these values come from a shared configuration file somewhere else, so they need to be structured like this.

SFTP_HOST=xxxx.de
SFTP_USER=xxxx
SFTP_KEYFILE=/root/.ssh/id_backup
BACKUP_NAME=test
KEY_ID=ABCDEF12

COMMON_ARGS="--archive-dir /backup --ssh-options=\"-oIdentityFile=$SFTP_KEYFILE\""
COMMON_BACKUP_ARGS="$COMMON_ARGS --name $BACKUP_NAME --encrypt-sign-key $KEY_ID"

SOURCE=/tmp
DEST=sftp://address@hiddenHOST/backup-$BACKUP_NAME

export PASSPHRASE=

duplicity $COMMON_BACKUP_ARGS $FULL_EVERY_DAYS "$SOURCE" "$DEST"

The result is this:

BackendException: ssh connection to address@hidden:22 failed: [Errno 2] No such file or directory: '/root/.ssh/id_backup"'

Note the extra " at the end of the SSH key file name. It's not supposed to be there. Is duplicity not parsing shell arguments right? If I specify the --ssh-options argument directly with the duplicity call, not inside a variable, it works fine. So my setup is basically correct. This change where I want that parameter for all different duplicity calls just can't be parsed.

I know that in this case I might just leave out the nested quotes. But as soon as I need a second SSH option, it's mandatory.

My shell is bash on Ubuntu 14.04. Duplicity 0.6.23.

--
Yves Goergen
http://unclassified.de
http://dev.unclassified.de

_______________________________________________
Duplicity-talk mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/duplicity-talk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]