Sebastian writes:
> This is my first post so let me thank Craig and contributors for this
> excellent software.
Thanks.
> Now here is my problem.
>
> I have a bash to connect with ssh:
> /path/to/ssh.sh "var 1" var2
> it runs ok from command line but if i use it in the config file it doesn't
> work
>
> $Conf{DumpPreUserCmd} = '/path/to/ssh.sh "var 1" var2';
>
> It seems to have problems with the whitespace of parameters. I also tried with
> \' and \" with no success.
BackupPC doesn't use a shell to execute the commands (which is why
you need a full path for the executable). So quoting doesn't work.
If you specify a string it simply breaks at white space, as you
discovered.
Instead you can specify an array to specify exactly what the
arguments are, eg:
$Conf{DumpPreUserCmd} = ['/path/to/ssh.sh', 'var 1', 'var2'];
This is true for any Cmd configuration variable.
Note to self: that array form isn't supported by the config editor.
I'll have to figure out what to do about that...
Craig
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/