BackupPC-users

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

2011-08-05 12:10:45
Subject: Re: [BackupPC-users] How do I configure DumpPreUserCmd to have multiple commands
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Fri, 05 Aug 2011 12:08:47 -0400
Jeffrey J. Kosowsky wrote at about 11:36:13 -0400 on Friday, August 5, 2011:
 > Holger Parplies wrote at about 15:01:45 +0200 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).

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
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/