[Bacula-users] job run script error

2009-09-30 Thread Joseph L. Casale
I am trying to execute a simple scp of the bootstrap files after the catalog 
backup.
It always says:
ClientAfterJob: /var/lib/bacula/*.bsr: No such file or directory
When run as root at the shell, it works fine. As the director runs as bacula, I
checked perms, and /var/lib/bacula and all the .bsr files are owned by bacula?

What simple nuance am I overlooking here?

Thanks!
jlc

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] job run script error

2009-09-30 Thread Dajka Tamas
Hi,

Shouldn't it be "RunAfterJob", since the bootstrap files are on the director?

On the JobDef, where are you putting the bootstraps? ( for me, in the default 
JobDef there's 'Write bootstrap = "/var/lib/bacula/%c_%t_%n.bsr" ' - %c = 
client name, %t = job type, %n = jobname )

Cheers,

  Tom


Feladó: Joseph L. Casale [jcas...@activenetwerx.com]
Küldve: 2009. szeptember 30. 17:30
Címzett: bacula-users@lists.sourceforge.net
Tárgy: [Bacula-users] job run script error

I am trying to execute a simple scp of the bootstrap files after the catalog 
backup.
It always says:
ClientAfterJob: /var/lib/bacula/*.bsr: No such file or directory
When run as root at the shell, it works fine. As the director runs as bacula, I
checked perms, and /var/lib/bacula and all the .bsr files are owned by bacula?

What simple nuance am I overlooking here?

Thanks!
jlc

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users




This e-mail and any files transmitted with it are confidential and intended 
solely for the use of the individual/entity to which they are addressed. If you 
are not the intended recipient, you are notified that disclosing, copying, 
distributing or taking any action in reliance on the contents of this 
information is strictly prohibited. Additionally, please note that 
communication by e-mail guarantees neither the confidentiality, nor the 
completeness, or proper receipt of the messages sent. Furthermore, UPC 
Magyarország Kft., its affiliates and third parties retained by them may 
monitor, copy, use or forward to third parties any outgoing messages from and 
incoming messages to this email address.

Jelen e-mail és csatolt állományai bizalmasak, és kizárólag a címzett 
személynek/szervezeti egységnek szólnak. Amennyiben nem Ön a címzett, 
tájékoztatjuk arról, hogy a tartalmának felfedése, másolása, továbbítása, vagy 
bármely célból történő felhasználása szigorúan tilos. Megjegyezzük, hogy az 
e-mail útján történő közlések nem garantálják az elküldött üzenetek bizalmas 
jellegének és teljességének megőrzését, valamint az üzenetek megfelelő 
kézbesítését. A fentieken túlmenően, a UPC Magyarorszag Kft., annak kapcsolt 
vállalkozásai, illetve az általuk megbízott harmadik felek a jelen e-mail 
címről küldött, vagy arra érkező bármely üzenetet ellenőrizhetnek, 
lemásolhatnak, felhasználhatnak, vagy harmadik fél részére továbbíthatnak.
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] job run script error

2009-09-30 Thread Joseph L. Casale
>Hi,
>
>Shouldn't it be "RunAfterJob", since the bootstrap files are on the director?
>
>On the JobDef, where are you putting the bootstraps? ( for me, in the default 
>JobDef there's 'Write bootstrap = "/var/lib/bacula/%c_%t_%n.bsr" ' - %c = 
>client name, %t = job >type, %n = jobname )
>
>Cheers,

Hmm,

I had the following:
  RunScript {
  RunsWhen = After
  RunsOnFailure = Yes
  FailJobOnError = Yes
  Command = "scp -i /path/to/key -o StrictHostkeyChecking=no 
/var/lib/bacula/*.bsr u...@host:/path/Bacula/"
  Command = "/usr/lib/bacula/delete_catalog_backup"
  }

But I missed the part where the default is "runs on client". I since then
added "RunsOnClient = No" (even though the client in this case is the director)
which only changed the error to:

AfterJob: /var/lib/bacula/*.bsr: No such file or directory

If the same string is in a shell script, and the command simply points to it,
it works.

Thanks!
jlc

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] job run script error

2009-09-30 Thread Steve Ellis
On 9/30/2009 10:04 AM, Joseph L. Casale wrote:
> Hmm,
> I had the following:
>RunScript {
>RunsWhen = After
>RunsOnFailure = Yes
>FailJobOnError = Yes
>Command = "scp -i /path/to/key -o StrictHostkeyChecking=no 
> /var/lib/bacula/*.bsr u...@host:/path/Bacula/"
>Command = "/usr/lib/bacula/delete_catalog_backup"
>}
>
> But I missed the part where the default is "runs on client". I since then
> added "RunsOnClient = No" (even though the client in this case is the 
> director)
> which only changed the error to:
>
> AfterJob: /var/lib/bacula/*.bsr: No such file or directory
>
> If the same string is in a shell script, and the command simply points to it,
> it works.
>
> Thanks!
> jlc
>
>

The problem you are hitting is perhaps subtle, but the issue is that 
there is no shell to expand the '*' in your command line--the easiest 
answer might be to put the two commands you have in a shell script and 
invoke that instead as a run script--then, there will be a shell running 
to do the filename expansion.

Hope this helps,

-se

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] job run script error

2009-09-30 Thread Tobias Brink
Hi!

"Joseph L. Casale"  writes:

> I had the following:
>   RunScript {
>   RunsWhen = After
>   RunsOnFailure = Yes
>   FailJobOnError = Yes
>   Command = "scp -i /path/to/key -o StrictHostkeyChecking=no 
> /var/lib/bacula/*.bsr u...@host:/path/Bacula/"
>   Command = "/usr/lib/bacula/delete_catalog_backup"
>   }
>
> But I missed the part where the default is "runs on client". I since then
> added "RunsOnClient = No" (even though the client in this case is the 
> director)
> which only changed the error to:
>
> AfterJob: /var/lib/bacula/*.bsr: No such file or directory
>
> If the same string is in a shell script, and the command simply points to it,
> it works.

That’s because the shell interprets the * glob but bacula doesn’t.
The shell will replace "/var/lib/bacula/*.bsr" with a list of matching
file names (if these files exists) while bacula will send the string
as is to the program.  The solution is to put your command into a
shell script and execute the shell script from bacula.

HTH,
Tobias

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] job run script error

2009-09-30 Thread Joseph L. Casale
>That’s because the shell interprets the * glob but bacula doesn’t.
>The shell will replace "/var/lib/bacula/*.bsr" with a list of matching
>file names (if these files exists) while bacula will send the string
>as is to the program.  The solution is to put your command into a
>shell script and execute the shell script from bacula.

Thanks everyone,
It does work fine in a shell script. One thing left that is odd, if
I don’t specify "where" to run it, it does run by default on the dir
in this case and functions properly in the sense that if there is an
error, the job fails as specified.

If I specify "RunsOnClient = No" for the sake of clarity, even with
"FailJobOnError = Yes" if the shell script bombs the job reports success.

Why when I don't specify the location does it behave as expected and
report an error if the script fails?

Thanks!
jlc
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users