Can't backup into a directory

Asked by Tim Chi

When i ran this script:

duplicity /disk2/repositories/subversion/repos/projrod scp://user@host --ssh-backend=pexpect --ssh-askpass

it would allow me to backup to the $HOME directory. But when i ran this script:

duplicity /disk2/repositories/subversion/repos/projrod scp://user@host/DupTest --ssh-backend=pexpect --ssh-askpass

(I added a directory at the target location) it would give me this error with 5 attempts:

Running 'sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 user@host' with commands:
 put "/tmp/duplicity-Qc5yIC-tempdir/mktemp-a1PNqi-2" "DupTest/.duplicity-full.20130910T165736Z.vol1.difftar.gpg.part"
 rename "DupTest/.duplicity-full.20130910T165736Z.vol1.difftar.gpg.part" "DupTest/duplicity-full.20130910T165736Z.vol1.difftar.gpg"
 failed (attempt #1): Permission denied

any help would be appreciated

Thanks
-Tim

Question information

Language:
English Edit question
Status:
Solved
For:
Duplicity Edit question
Assignee:
No assignee Edit question
Solved by:
Tim Chi
Solved:
Last query:
Last reply:
Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#1

The target URL is relative to the $HOME directory. Is that what you want?

You can make it absolute with user@host//DupTest if that's what you wanted.

On Tue, Sep 10, 2013 at 12:31 PM, Tim Chi <
<email address hidden>> wrote:

> New question #235468 on Duplicity:
> https://answers.launchpad.net/duplicity/+question/235468
>
> When i ran this script:
>
> duplicity /disk2/repositories/subversion/repos/projrod scp://user@host--ssh-backend=pexpect --ssh-askpass
>
> it would allow me to backup to the $HOME directory. But when i ran this
> script:
>
> duplicity /disk2/repositories/subversion/repos/projrod scp://user@host/DupTest
> --ssh-backend=pexpect --ssh-askpass
>
> (I added a directory at the target location) it would give me this error
> with 5 attempts:
>
> Running 'sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 user@host'
> with commands:
> put "/tmp/duplicity-Qc5yIC-tempdir/mktemp-a1PNqi-2"
> "DupTest/.duplicity-full.20130910T165736Z.vol1.difftar.gpg.part"
> rename "DupTest/.duplicity-full.20130910T165736Z.vol1.difftar.gpg.part"
> "DupTest/duplicity-full.20130910T165736Z.vol1.difftar.gpg"
> failed (attempt #1): Permission denied
>
> any help would be appreciated
>
> Thanks
> -Tim
>
>
> --
> You received this question notification because you are a member of
> duplicity-team, which is an answer contact for Duplicity.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~duplicity-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~duplicity-team
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Tim Chi (timmy-g-chi) said :
#2

I tried your suggested solution but it gave me this error:

failed (attempt #5): Remote file or directory does not exist in command='sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 user@host'
BackendException: Giving up trying to execute 'sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 user@host' with commands:
 mkdir "/DupTest"
 cd "/DupTest"
 ls -1
 after 5 attempts

I want to backup to that target URL in a new directory(DupTest) within the $HOME directory.

Revision history for this message
Tim Chi (timmy-g-chi) said :
#3

On another note, if I have machine1 and machine2. I want to have duplicity on machine1 and I want to pull backups from machine2 to machine1. What would the commands to do that if I am working on machine1?

I have tried:

duplicity sftp://user@host/projrod(from machine2) /~(machine1) --ssh-backend=pexpect --ssh-askpass

Thanks
-Tim

Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#4

Please run duplicity with the -v9 option and save the entire log to file.
 Very carefully obscure passwords and such, but leave everything else as
is. Then post the log on http://pastebin.ubuntu.com/ and reply with the
link to the pasted file.

...Thanks,
...Ken

On Tue, Sep 10, 2013 at 4:01 PM, Tim Chi <
<email address hidden>> wrote:

> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> On another note, if I have machine1 and machine2. I want to have
> duplicity on machine1 and I want to pull backups from machine2 to
> machine1. What would the commands to do that if I am working on
> machine1?
>
> I have tried:
>
> duplicity sftp://user@host/projrod(from machine2) /~(machine1) --ssh-
> backend=pexpect --ssh-askpass
>
>
> Thanks
> -Tim
>
> --
> You received this question notification because you are a member of
> duplicity-team, which is an answer contact for Duplicity.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~duplicity-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~duplicity-team
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Tim Chi (timmy-g-chi) said :
#5

http://pastebin.ubuntu.com/6092952/

I am running Duplicity on Ubuntu 12.04.3

Revision history for this message
edso (ed.so) said :
#6

On 11.09.2013 17:35, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Status: Answered => Open
>
> Tim Chi is still having a problem:
> http://pastebin.ubuntu.com/6092952/
>
> I am running Duplicity on Ubuntu 12.04.3
>

it pretty clearly states

"failed (attempt #2): Host key authenticity could not be verified (missing known_hosts entry?)"

you can solve this by manually running (as the user duplicity is supposed to run with) ssh against the remote machine and accepting the remote hosts key.

question:

why are you using pexpect ssh backend?

..ede/duply.net

Revision history for this message
Tim Chi (timmy-g-chi) said :
#7

I tried your solution and this is what I get after: http://pastebin.ubuntu.com/6093062/

To answer your question, I'm not quite sure why I am using pexpect ssh backend..but the result without it is: http://pastebin.ubuntu.com/6093080/

Thanks
-Tim

Revision history for this message
edso (ed.so) said :
#8

On 11.09.2013 18:06, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> I tried your solution and this is what I get after:
> http://pastebin.ubuntu.com/6093062/
>
> To answer your question, I'm not quite sure why I am using pexpect ssh
> backend..but the result without it is:
> http://pastebin.ubuntu.com/6093080/
>
> Thanks
> -Tim
>

is there actually a folder

disk2/repositories/subversion/repos/projrod

located in user@host home directory?

if you are confused on how to restore selected files or folders of your backup please see manpage, section Examples
http://duplicity.nongnu.org/duplicity.1.html#sect4

esentially you'll have to use the --file-to-restore option. a syntax summary of the restore action can be found in section Actions
http://duplicity.nongnu.org/duplicity.1.html#toc5

..ede

Revision history for this message
Tim Chi (timmy-g-chi) said :
#9

I'm trying to make a backup.

When I use this script on the source machine:

duplicity /disk2/repositories/subversion/repos/projrod scp://user@host --ssh-askpass

It works perfectly. But I want to make a backup from my target location.

Revision history for this message
edso (ed.so) said :
#10

On 11.09.2013 18:41, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Status: Answered => Open
>
> Tim Chi is still having a problem:
> I'm trying to make a backup.
>
> When I use this script on the source machine:
>
> duplicity /disk2/repositories/subversion/repos/projrod scp://user@host
> --ssh-askpass
>
> It works perfectly. But I want to make a backup from my target location.
>

read the man page... again section Actions
http://duplicity.nongnu.org/duplicity.1.html#toc5

duplicity detects from the order url and local path are given, what mode (backup vs. restore) it must switch to.

btw. duplicity only backs up local data to remote. it cannot access and backup remote data!

..ede/duply.net

Revision history for this message
Tim Chi (timmy-g-chi) said :
#11

Oh, ok I'm starting to get it now. That was helpful, thank you.

So when I tried:

duplicity full /local_source scp://user@host --ssh-askpass

It would work perfectly.

But when I try to put the backup files in a directory at the target location:

duplicity full /local_source scp://user@host/target_directory --ssh-askpass

then i would get:

sftp put of /tmp/duplicity-mey8tl-tempdir/mktemp-QxcZ8n-2 (as duplicity-full.20130911T170112Z.vol1.difftar.gpg) failed: [Errno 13] Permission denied (Try 1 of 5) Will retry in 10 seconds.
^CRemoving still remembered temporary file /tmp/duplicity-mey8tl-tempdir/mktemp-QxcZ8n-2
Removing still remembered temporary file /tmp/duplicity-mey8tl-tempdir/mkstemp-krf3S9-1

Can I not backup files in a specific directory at the target location?

Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#12

Can you manually scp a file to user@host/target_directory?

On Wed, Sep 11, 2013 at 12:11 PM, Tim Chi <
<email address hidden>> wrote:

> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> Oh, ok I'm starting to get it now. That was helpful, thank you.
>
> So when I tried:
>
> duplicity full /local_source scp://user@host --ssh-askpass
>
> It would work perfectly.
>
> But when I try to put the backup files in a directory at the target
> location:
>
> duplicity full /local_source scp://user@host/target_directory --ssh-
> askpass
>
> then i would get:
>
> sftp put of /tmp/duplicity-mey8tl-tempdir/mktemp-QxcZ8n-2 (as
> duplicity-full.20130911T170112Z.vol1.difftar.gpg) failed: [Errno 13]
> Permission denied (Try 1 of 5) Will retry in 10 seconds.
> ^CRemoving still remembered temporary file
> /tmp/duplicity-mey8tl-tempdir/mktemp-QxcZ8n-2
> Removing still remembered temporary file
> /tmp/duplicity-mey8tl-tempdir/mkstemp-krf3S9-1
>
> Can I not backup files in a specific directory at the target location?
>
> --
> You received this question notification because you are a member of
> duplicity-team, which is an answer contact for Duplicity.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~duplicity-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~duplicity-team
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Tim Chi (timmy-g-chi) said :
#13

hmm when i try to scp:

scp README.txt user@host/DupTest

it gives me the following:

cp: cannot create regular file `user@host/DupTest': No such file or directory

Revision history for this message
edso (ed.so) said :
#14

On 11.09.2013 22:11, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> hmm when i try to scp:
>
> scp README.txt user@host/DupTest
>
> it gives me the following:
>
> cp: cannot create regular file `user@host/DupTest': No such file or
> directory
>

scp syntax is 'scp foo.txt user@host:folder/' note the colon char. see
http://linux.die.net/man/1/scp

of course the folder has to exist beforehand. can you create folders as that user on the target machine? via ssh for example.

..ede

Revision history for this message
Tim Chi (timmy-g-chi) said :
#15

oh right. I got a Permission denied.

Revision history for this message
Tim Chi (timmy-g-chi) said :
#16

i'm not sure if this is the problem, but I checked the /.ssh/known_hosts file from the remote machine. And the SSH host key from my local machine exists there.

Revision history for this message
edso (ed.so) said :
#17

On 11.09.2013 22:31, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> oh right. I got a Permission denied.
>

solve that and your problems will vanish.. ede/duply.net

Revision history for this message
Tim Chi (timmy-g-chi) said :
#18

I've managed to solve the permission problem.
Now I have a few questions about restore. Is it better/possible to restore from the backups location or the restore-target location?

When I tried to restore from the restore-target location with:

duplicity restore scp://user@host/backup_source_directory /DupRestore --ssh-askpass

I get the following errors:

Making directory /DupRestore
Error '('Error creating directory /DupRestore', 7)' processing .
Skipping README.txt because of previous error
Skipping conf because of previous error
Skipping conf/authz because of previous error
.
.
.

Thanks for the help
-Tim

Revision history for this message
edso (ed.so) said :
#19

On 12.09.2013 22:21, Tim Chi wrote:
> Question #235468 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/235468
>
> Tim Chi posted a new comment:
> I've managed to solve the permission problem.
> Now I have a few questions about restore. Is it better/possible to restore from the backups location or the restore-target location?

can you rephrase? i don't know what you mean?

>
> When I tried to restore from the restore-target location with:
>
> duplicity restore scp://user@host/backup_source_directory /DupRestore
> --ssh-askpass
>
> I get the following errors:
>
> Making directory /DupRestore
> Error '('Error creating directory /DupRestore', 7)' processing .
> Skipping README.txt because of previous error
> Skipping conf because of previous error
> Skipping conf/authz because of previous error
> .

are you allowed to create the folder /DupRestore at your filesystem root as the user you are running duplicity as?

..ede/duply.net

Revision history for this message
Tim Chi (timmy-g-chi) said :
#20

Can i make a restore from the target location (where i want to restore to) or am I suppose to restore from where the backups are located?

oh hmm I seem to not have permission to create directories...
I think that is my problem. Thank you very much