BackupPC-users

Re: [BackupPC-users] Pre/PostUserCmd: More than one?

2013-09-17 07:40:42
Subject: Re: [BackupPC-users] Pre/PostUserCmd: More than one?
From: Dennis Ditte <dennis AT double-d DOT it>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 17 Sep 2013 13:38:42 +0200


If the (implied) script is simple as per the OP's desire to run just
two shell commands, it would be easier to use 'bash -c'
I think the following would work...

$Conf{DumpPreUserCmd} = 'bash -c "touch /var/lock/backuppc/BackupPC;
		$sshPath -q -x -l root $host touch /var/lock/backuppc/BackupPC"';

I haven't tested that but I don't see why it wouldn't work...


I tested it and it don't work. I think the  " " are a problem. I tried to escape them with \ but it doesn't work:

Executing DumpPostUserCmd: bash -c "rm -rf /var/lock/backuppc/backuppc-10.1.1.10; /usr/bin/ssh -q -x -l root 10.1.1.10 rm -rf /var/lock/backuppc/backuppc-10.1.1.10"
-rf: -c: Zeile 0: End of file 'is reached when searching for `".
-rf: -c: Zeile 1: syntax error: unexpected end of file..

Executing DumpPostUserCmd: bash -c \"rm -rf /var/lock/backuppc/backuppc-10.1.1.10; /usr/bin/ssh -q -x -l root 10.1.1.10 rm -rf /var/lock/backuppc/backuppc-10.1.1.10\"
-rf: "rm: Command not found.

Any ideas?

--
Dennis Ditte
Webdesign, IT-Strukturen, Administration
--------------------------------------------------
dennis AT double-d DOT it
Tel. +49(0)531 - 22459334, Mobil +49(0)162 - 4466226
--------------------------------------------------

Rheinring 58
38120 Braunschweig, Deutschland
http://www.double-d.it
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
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/