On 11/21/2016 8:41 AM, Kostis Fardelas wrote:
> $ICICMD has the full path. If I run the script from command line, the
> script works. But if I let bacula run it, it throws a FATAL error.

When the bacula-fd daemon launches your script, the script inherits its 
environment from the bacula-fd process. It may well be different than 
the environment that gets set up when you login to a shell. In 
particular, the $PATH environment variable may be different, causing 
which to not find ici.

>
> On 21 November 2016 at 15:06, Bill Arlofski <waa-bac...@revpol.com> wrote:
>> On 11/21/2016 07:37 AM, Kostis Fardelas wrote:
>>> Hello community,
>>> I am trying to run a script as a Client Run Before Job
>>>
>>> Client Run Before Job = "/etc/bacula/scripts/mysqlxtra_dt"
>>>
>>> The script:
>>> #!/bin/sh
>>>
>>> ICICMD=$(which ici)
>>> $ICICMD -dt 3600 -svc 'mysql-replication' > /dev/null
>>>
>>> But the job keeps failing with:
>>> "ClientRunBeforeJob: /etc/bacula/scripts/mysqlxtra_dt: 7:
>>> /etc/bacula/scripts/mysqlxtra_dt: -dt: not found"
>>>
>>> What am I doing wrong?
>>>
>>> Best regards,
>>> Kostis
>> Hi Kostis,
>>
>> My fisrt guess is that $(which ici) is returning a null string, so the
>> variable $ICICMD is empty, and hence the command that is actually being 
>> called is
>>
>> "-dt 3600 -svc 'mysql-replication' > /dev/null"
>>
>> You need to double-check and verify that $(which ici) returns the full
>> path/filename of the command you are attempting to assign.
>>
>> Best regards,
>>
>> Bill
>>
>>
>>
>> --
>> Bill Arlofski
>> http://www.revpol.com/bacula
>> -- Not responsible for anything below this line --
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
> ------------------------------------------------------------------------------
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to