Bacula-users

[Bacula-users] Script for checking a client status

2009-04-28 07:42:27
Subject: [Bacula-users] Script for checking a client status
From: Personal Técnico <tecnicos AT caos.uab DOT es>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 28 Apr 2009 13:37:10 +0200
Hi,

I check a client status before run a job with this script, called 
"check-status-client.sh":

-------------------------------------
#! /bin/bash
bconsole <<FINAL_DATOS
@output /var/log/bacula/$1 w
status client=$1
quit
FINAL_DATOS

ESTADO_CLIENTE=""
ESTADO_CLIENTE=`grep "Failed to connect to Client" /var/log/bacula/$i`

if [ -z "$ESTADO_CLIENTE" ] ; then
        exit 0  ## NO ERROR
else
        exit -1 ## HA HABIDO ERROR
fi
-------------------------------------

Into job definition, we have something like this
Job {
     ...
    Run Before Job = "/etc/bacula/scripts/check-status-client.sh '%c'"
    ...
}


And file created into script (/var/log/bacula/$1)

Connecting to Client client-fd at X.Y.Z.72:9102
Failed to connect to Client client-fd.
====
You have messages.
quit

With this result, script exit would be "-1" and job should be cancelled 
and not tried to run...


In some document, I read if script exit with value different from 0 
would mean script had exited with error and job won't run (in other 
words, bacula would not try to connect with client).
However, I'm getting errors from a client that is not allowing access 
(or is shut down), but messages from bacula shows following information:

28-Apr 13:00 aosnap JobId 6195: No prior Full backup Job record found.
28-Apr 13:00 aosnap JobId 6195: No prior or suitable Full backup found 
in catalog. Doing FULL backup.
28-Apr 13:01 aosnap JobId 6195: BeforeJob: run command 
"/etc/bacula/scripts/check-status-client.sh 'client-fd'"
28-Apr 13:01 aosnap JobId 6195: BeforeJob: Connecting to Director 
aosnap:9101
28-Apr 13:01 aosnap JobId 6195: BeforeJob: 1000 OK: aosnap Version: 
2.4.3 (10 October 2008)
28-Apr 13:01 aosnap JobId 6195: BeforeJob: Enter a period to cancel a 
command.
28-Apr 13:01 aosnap JobId 6195: BeforeJob: @output /var/log/bacula/client w
28-Apr 13:04 aosnap JobId 6195: Start Backup JobId 6195, 
Job=Backup-Client.2009-04-28_13.00.25
28-Apr 13:04 aosnap JobId 6195: Using Device "BaculaBackups"
28-Apr 13:11 aosnap JobId 6195: Warning: bsock.c:123 Could not connect 
to Client: client-fd on X.Y.Z.72:9102. ERR=Connection timed out
Retrying ...
28-Apr 13:19 aosnap JobId 6195: Fatal error: bsock.c:129 Unable to 
connect to Client: client-fd on X.Y.Z.72:9102. ERR=Interrupted system call
28-Apr 13:19 aosnap JobId 6195: Error: Bacula aosnap 2.4.3 (10Oct08): 
28-Apr-2009 13:19:58
  Build OS:               x86_64-unknown-linux-gnu suse 10
  JobId:                  6195
  Job:                    Backup-Client.2009-04-28_13.00.25
  Backup Level:           Full (upgraded from Incremental)
  Client:                 "client-fd" 2.4.3 (10Oct08) 
Linux,Cross-compile,Win32
  FileSet:                "Usuario-Windows" 2008-11-24 12:34:05
  Pool:                   "JS" (From Job resource)
  Storage:                "BackupRAID5" (From Pool resource)
  Scheduled time:         28-Apr-2009 13:00:00
  Start time:             28-Apr-2009 13:04:48
  End time:               28-Apr-2009 13:19:58
  Elapsed time:           15 mins 10 secs
  Priority:               12
  FD Files Written:       0
  SD Files Written:       0
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  VSS:                    no
  Storage Encryption:     no
  Volume name(s):        
  Volume Session Id:      67
  Volume Session Time:    1240639692
  Last Volume Bytes:      1 (1 B)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status: 
  SD termination status:  Waiting on FD
  Termination:            *** Backup Error ***


It seems scripts it's running, although getting an "exit -1", bacula 
tries to run backup.


Am I doing anything wrong?

Thanks.



------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>