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 16:23:28 -0600

As a past consultant on Software Configuration Management, I can freely say, without a doubt, that the whole LTS process is a nightmare. What it amounts to is a separate development tree for each release operating in parallel with all the other releases. You may be applying the same fix to 10 releases at 10 different version numbers and 10 source trees. Add in the fact that the LTS cycle will not allow you to 'enhance' the product, you the consumer lose out.  I can help to a point, but when it comes down to a person or company with their head stuck in the LTS quagmire, I stop.

We have upgrade versions available, a PPA with the newest 0.7 version, and limited resources.  This bug will get fixed.  It will probably never make it into older LTS versions because the version being fixed is well beyond 0.6.23.  Sorry about that.

On Tue, Dec 9, 2014 at 3:55 PM, Yves Goergen <address@hidden> wrote:
Am 09.12.2014 um 22:03 schrieb Yves Goergen:
COMMON_ARGS="--archive-dir /backup --ssh-options=\"-oIdentityFile=$SFTP_KEYFILE\""

I've tried to modify this line to avoid the nested quotes. Here's something that doesn't scale, but what does anyway in a shell script?

COMMON_ARGS=--archive-dir\ /backup\ --ssh-options="-oIdentityFile=$SFTP_KEYFILE"

This removes the outer quotes and keeps the string as one with backslashes before each space. Here's a surprising result:

> echo $COMMON_ARGS
--archive-dir /backup --ssh-options=-oIdentityFile=/root/.ssh/id_backup

The other quotes are completely gone. Now let me expand my example:

COMMON_ARGS=--archive-dir\ /backup\ --ssh-options="-oIdentityFile=$SFTP_KEYFILE -oSecond=2"
> echo $COMMON_ARGS
--archive-dir /backup --ssh-options=-oIdentityFile=/root/.ssh/id_backup -oSecond=2

Now the -oSecond=2 part is completely independent of the --ssh-options parameter. That probably won't work for duplicity anymore I guess.

I've read somewhere "You cannot quote quotes and expect the shell to unquote them for you." While that makes sense, I'm questioning the purpose of bash as a scripting language for anything more complex than simple letters and numbers. (I'm not a bash expert, and I might consider reimplementing my backup script in some more advanced and predictable language.)

Wouldn't it be the easiest solution to let duplicity accept the --ssh-options parameter multiple times for each SSH option to declare? I know that wouldn't help me now because I'm stuck at this version for the next two years of LTS, but it may be helpful some time in the future.

It's duplicity's manpage itself that recommends using quotes:

http://duplicity.nongnu.org/duplicity.1.html
duplicity --ssh-options="-oProtocol=2 -oIdentityFile=/my/backup/id"

--
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]