On 21 November 2016 at 15:58, Gary R. Schmidt <g...@mcleod-schmidt.id.au> wrote: > On 22/11/2016 00:40, Kostis Fardelas wrote: >> 755 and extension is not needed. I have a lot of other scripts that do >> not have extensions, but none that calls a secondary script with >> arguments >> >> On 21 November 2016 at 15:06, Francisco Javier Funes Nieto >> <esen...@gmail.com> wrote: >>> Permissions on the script file? >>> The file finish with .sh extension? >>> >>> J. >>> >>> >>> 2016-11-21 13:37 GMT+01:00 Kostis Fardelas <dante1...@gmail.com>: >>>> >>>> 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? >>>> > > First - top posting. > > Second - Either "which" or "ici" (or both) are not in the limited PATH > that a bacula-fd is given. Either specify a PATH or use full paths to > commands. > > Cheers, > >
(I tend to use the same posting style as the previous sender. You changed that, so my turn to follow up) Finally I found it and wanted to share. After some trial and error, I found that the script was borking on a os.environ KeyError exception (python) when bacula user was trying to execute it (/bin/false as shell). Added a try/except section and everything rolls again. Thanks a lot for you answers! ------------------------------------------------------------------------------ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users