BackupPC-users

Re: [BackupPC-users] How do I configure DumpPreUserCmd to have multiple commands

2011-08-08 21:02:20
Subject: Re: [BackupPC-users] How do I configure DumpPreUserCmd to have multiple commands
From: Holger Parplies <wbppc AT parplies DOT de>
To: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
Date: Tue, 9 Aug 2011 02:58:57 +0200
Hi,

Jeffrey J. Kosowsky wrote on 2011-08-05 12:08:47 -0400 [Re: [BackupPC-users] 
How do I configure DumpPreUserCmd to have?multiple?commands]:
> Jeffrey J. Kosowsky wrote at about 11:36:13 -0400 on Friday, August 5, 2011:
>  > All I can say is that the form bash -c "code..." does work.
>  > I use the following 'monstrosity' to query if rsyncd is running and
>  > start cygwin rsyncd on my Windows machine if it isn't.
>  > 
>  > $Conf{RestorePreUserCmd} =
>  >   "\$sshPath -q -x -l  $Conf{RsyncdUserName} \$hostIP bash -c 
> '/bin/cygrunsrv -Q rsyncd | /bin/egrep -q    \"Current State *: *Running\" || 
> ( /usr/bin/rm -f /var/run/rsyncd.pid; /bin/cygrunsrv -S rsyncd ; sleep 20)'";
> 
> Correction - I just realized that I am using 'bash -c' in a different
> way in that it is passed to ssh and executed on the client side.
> 
> You are exactly right that 'bash -c "blah blah blah"' fails since the
> quote mechanism doesn't work without a shell. It's too bad that there
> isn't an option that allows a "bash -c" like construction to interpret
> everything that follows (up to perhaps a delimitter) to be interpreted
> as part of the command line (though white space would need to be escaped).

actually, there is: it's called a shell script ;-). I can understand that you
don't want to keep scripts on your *clients* (whether Windoze or real
computers), but on the server you could use $TopDir/bin and keep them with
your pool, or /usr/local/sbin to keep them with your configuration. You could
even abuse your host.pl file so it does different things when called with a
'RestorePreUserCmd' command line argument ;-).

If you're really desperate, there is a way, though I'm *not* going to suggest
$sshPath -q -x localhost ... that would be a really ugly hack :).

Regards,
Holger

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
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/