← Back to team overview

duplicity-team team mailing list archive

Re: [Question #289684]: duplicity URL & variable parsing (webDAV) in shell-script

 

Question #289684 on Duplicity changed:
https://answers.launchpad.net/duplicity/+question/289684

    Status: Open => Answered

edso proposed the following answer:
On 31.03.2016 20:13, nomennominatur wrote:
> Question #289684 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/289684
> 
> Description changed to:
> # I am not a seasoned Ubuntu admin/ Duplicity user, so please bear with
> me if I am missing something obvious...
> 
> 1. Many WebDAV-providers supply usernames as
> "emailaddress@xxxxxxxxxxxx". Although this does not seem to be RFC-
> compliant, users have to live with that anyway...

which RFC would that be
 
> 2. Many WebDAV backends ignore duplicity's FTP_PASSWORD environment
> variable.

the current two webdav backends use FTP_PASSWORD, if it ss set.

> 3. Duplicity works OK when I provide cleartext password from CLI, e.g.
> 
>     <duplicity /localdir
> webdavs://'emailaddress@xxxxxxxxxxxx':cleartextpassword@xxxxxxxxxxxxxxxxxxxxxxx/remotedir>

make sure to url encode the @, the above is clearly breaking the standard eg. like
 http://stackoverflow.com/questions/10050877/url-username-with
 
> 4. However, I do not want to use my cleartext password in the command
> line process so that other users might not spoof it from the process
> list

as said above, use FTP_PASSWORD. it works
 
> 5. Trying to use duplicity from a shell script (bash), without using the
> cleartext password in the command, e.g.
> 
>     <PWVARIABLE='cleartextpassword'
>     export $PWVARIABLE
>     duplicity /localdir webdavs://'emailaddress@xxxxxxxxxxxx':$PWVARIABLE@xxxxxxxxxxxxxxxxxxxxxxx/remotedir>
> 
> I always run into parsing problems of the juxtaposed "@" symbol which,
> together with the WebDAV URL, will be parsed into the variable name.
> This does not seem to be relieved by exchanging "%40" for "@" as
> duplicity (or bash?) do not seem to parse this in a useful manner.

that also works fine for me, stick to the url encoded %40

> Putting "$PWVARIABLE" into quotes does not work either, since this seems
> to be parsed as plaintext and not as variable.
> 
> My aim is to run the script with cron for off-site backups.
> 
> Is there a workable syntax for this? Any help is greatly appreciated!
> 
> # Thanks & kudos for this great tool!
> 
> <<edit>>
> This site's laudable privacy filter automatically changes any string 'aaa<at>bbbbb.ccc' into a generic 'e-mail address'. This will, however, mess up other URLs in posts as well.
> 
> Just for clarification: In my syntax example above, it shoud read
> something like
> 
> <webdavs://'fullemailaddress':$PWVARIABLE<at>fullwebdavURL/remotedir>
> 
> Thanks!
> 

try

FTP_PASSWORD='supersecretpass'
duplicity /source webdavs://user%40host.tld@xxxxxxxxxxxxxx/targetfolder

quotation marks or @ have no place in the url's auth info.

make sure you use a recent duplicity. either 0.6.26 or the latest 0.7.x
..ede/duply.net

-- 
You received this question notification because your team duplicity-team
is an answer contact for Duplicity.