|Subject:||Re: [Duplicity-talk] SSH backend and shell escaping|
|Date:||Tue, 9 Dec 2014 15:25:39 -0600|
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.
COMMON_ARGS="--archive-dir /backup --ssh-options=\"-oIdentityFile=$SFTP_KEYFILE\""
COMMON_BACKUP_ARGS="$COMMON_ARGS --name $BACKUP_NAME --encrypt-sign-key $KEY_ID"
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.
Duplicity-talk mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|