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: edgar . soldin
Subject: Re: [Duplicity-talk] SSH backend and shell escaping
Date: Wed, 10 Dec 2014 11:27:57 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 09.12.2014 22:25, Kenneth Loafman wrote:
> 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@hidden/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.
>>

any specific reason not to use
 http://duply.net
or some other existing shell wrapper?

this would prevent possible shell script issues.

..ede/duply.net




reply via email to

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