BackupPC-users

Re: [BackupPC-users] Error restore with rsync and spaces in file names

2008-08-21 23:42:47
Subject: Re: [BackupPC-users] Error restore with rsync and spaces in file names
From: Holger Parplies <wbppc AT parplies DOT de>
To: Lukas Wymann <support AT i-d-l DOT ch>
Date: Fri, 22 Aug 2008 05:41:50 +0200
Lukas Wymann wrote on 2008-08-15 13:23:29 +0200 [Re: [BackupPC-users] Error 
restore with rsync and spaces in file names]:
> Holger Parplies schrieb:
> > Lukas Wymann wrote on 2008-08-14 18:05:28 +0200 [Re: [BackupPC-users] Error 
> > restore with rsync and spaces in file names]:
> >> [...]
> >>> Now, when I restore file2.doc, it creates the following "file":
> >>> /home/sub-directory/another\
> >>> where "another\ " is the file restored.
> >>>
> >>> It does not handle the spaces within the directory-name (same happnes
> >>> with file names containing spaces).
> >> using rsync locally, therefore not through ssh
> > 
> > you forgot to remove the '+' from argList, i.e. you have "$argList+" in
> > RsyncClientRestoreCmd ?
> 
> Thanks for the hint. I removed the "+" as you suggested, and again, it 
> restores "a file", but the file's name is now not "another\ ", but 
> simply "another".
> Investigated more into the escaping...
> 
> This is my RsyncClientRestoreCmd:
> /usr/bin/sudo /var/lib/backuppc/bin/rsyncSend $argList

ah, you're using a script. And sudo. I should have guessed. I should also
guess what command is actually being executed, but I won't.

> And the content of my rsyncSend file is:
> #/bin/sh -f
> /usr/bin/rsync $*

Try

        #!/bin/sh
        exec /usr/bin/rsync ${1+"$@"}

> (and it does not work either with exec /usr/bin/rsync $* nor with 
> /usr/bin/rsync "$*")

It shouldn't. Why are you using the wrapper script? It doesn't seem to do
anything except cause problems ... (and a security risk if it is writeable by
anyone except root).

Please provide the command being executed from the log file if it still
doesn't work.

> Finally I got it to restore the file on the correct place with the 
> correct name:
> RsyncClientRestoreCmd: /usr/bin/sudo $rsyncPath $argList

Ah. Should have read that first.

> Simple question I have left now: should I remove the "+" also in the 
> RsyncClientCmd, although it seems that it does do the backup?!?
> 
> my current RsyncClientCmd: /usr/bin/sudo $rsyncPath $argList+

Yes. 'sudo' doesn't invoke a shell, so you don't need a '+'. It won't make
a difference as long as there is nothing on the command line that needs
escaping.

Regards,
Holger

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/