Bacula-users

Re: [Bacula-users] pre-checking tape for next backup

2008-12-11 14:37:34
Subject: Re: [Bacula-users] pre-checking tape for next backup
From: Hemant Shah <hjrrs AT yahoo DOT com>
To: bacula-users AT lists.sourceforge DOT net, James Harper <james.harper AT bendigoit.com DOT au>
Date: Thu, 11 Dec 2008 11:35:31 -0800 (PST)

--- On Wed, 12/10/08, James Harper <james.harper AT bendigoit.com DOT au> wrote:

> From: James Harper <james.harper AT bendigoit.com DOT au>
> Subject: [Bacula-users] pre-checking tape for next backup
> To: bacula-users AT lists.sourceforge DOT net
> Date: Wednesday, December 10, 2008, 8:19 PM
> I asked this question a while back, but I'd like to now
> figure out a
> solution to it.
> 
> Basically, one of our clients used to run Amanda and now
> runs Bacula.
> Obviously Bacula is superior :) but one feature they miss
> from Amanda is
> the ability to be notified if the tape (external disk in
> this case) has
> not been changed.
> 
> At 11am, Amanda would check and send an email to the backup
> operator if
> the current tape was not suitable for tonights backup. At
> 3pm it checks
> again and if the current tape is still not suitable, it
> emails the
> operator and a few others, on the assumption that the
> operator is out of
> the office.
> 
> At some sites where we use tapes, the tape is ejected at
> the end of the
> backup so it's easy to just check if there is a tape
> inserted or not (it
> is reasonable to assume that if a tape has been put in that
> it's
> probably the right one) but for usb attached external disks
> it's not so
> simple, so I would like a more general solution...
> 
> My rules would be:
> 1. Check mounted volume - if no volume then send email
> 2. If status is 'Recycle' (or other immediately
> usable state) then no
> action
> 3. If status is 'Append' then send email (only room
> for one backup on a
> tape, maybe this would be configurable)
> 4. If status is 'Used' and it will still be
> 'protected from overwrite'
> at the time of the next scheduled backup then send email
> 5. If status is 'used' and the tape will be
> eligible for recycle at the
> time of the next backup then no action
> 6. Otherwise, the situation is something I haven't
> thought of so send an
> email to me so I can put a rule in for it.
> 
> #1 should just be a mount operation, but then how can I get
> the name of
> the volume that is currently mounted?
> 
> #2-6 should just be a bit of creative Sql and some
> scripting (Python?)
> 
> Any comments or suggestions?
> 
> James
> 
> 
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in
> Las Vegas, Nevada.
> The future of the web can't happen without you.  Join
> us at MIX09 to help
> pave the way to the Next Web now. Learn more and register
> at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

Here is a psuedo code of what I have done in a shell script:


  mt -f /dev/tapedevice status | grep ONLINE
  if [ $? != 0 ]
  then
      send e-mail that tape drive is empty.
  else
      # Read label from tape
      Label=$(echo readlabel | btape -c bacula-sd.conf /dev/tapedevice | grep 
VolName | cut -d':' -f 2)

     # Remove leading and trailing spaces
     Label=$(echo $Label)
     if [ -z $Label ]
     then
         # Unlabeled tape, take appropriate action.
     else
        # query the database for the volume name and
        # send appropriate e-mails.
     fi
  fi

Hemant Shah
E-mail: hjrrs AT yahoo DOT com



      

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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>