Bacula-users

Re: [Bacula-users] Sending notification to insert tape _before_ it is needed?

2008-09-01 10:41:32
Subject: Re: [Bacula-users] Sending notification to insert tape _before_ it is needed?
From: James Cort <james.cort AT u4eatech DOT com>
To: Brice Figureau <brice+bacula AT daysofwonder DOT com>
Date: Mon, 01 Sep 2008 15:41:07 +0100
Brice Figureau wrote:
> Hi,
> 
> I have a setup where each week an operator must change the tapes of an
> autochanger with a bunch of new tapes. The old one are stored offsite,
> and used again the week after. To do this, I defined 2 pools, one for
> even weeks, the other for odd weeks.
> 
> Now, I'd like bacula to send an e-mail on the days of the swap (ie
> monday for us), that says something along the lines of "Please load the
> PoolOdd tapes in the autochanger" (and respectively "Please load the
> PoolEven tapes").
> 
> Is it possible?
> 
> I know I can produce a cronjob to do that, outside of bacula, but doing
> it inside Bacula would allow to check if the tapes are already loaded
> (at least the one needed for nextvol) and then don't alert.

I have a similar problem; I need to know what tapes are shortly to be
recycled so they can be loaded into the autochanger but bacula doesn't
decide what tapes it's going to recycle until it actually does the
recycle process.

I just query the database backend directly and use the output of that to
notify what tapes need to be inserted.

It isn't perfect because obviously if a new version of bacula changes
the SQL schema I'll have to rewrite my script - but that's not happened yet.

The line I use is:

psql bacula -U bacula -c "select volumename, lastwritten, pool.name as
pool from media inner join pool on media.poolid = pool.poolid
  where (
    (extract('days' from (now() - media.lastwritten))>21 and
pool.name='DailyTape') or
    (extract('days' from (now() - media.lastwritten))>330 and
pool.name='MonthlyTape') or
    (extract('days' from (now() - media.lastwritten))>6570 and
pool.name='AnnualTape'))
  and inChanger=0
  and media.volstatus != 'Disabled'
  and media.volstatus != 'Error'
  order by lastwritten;"


-- 
James Cort

IT Manager
U4EA Technologies Ltd.

-- 
U4EA Technologies
http://www.u4eatech.com


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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>
  • Re: [Bacula-users] Sending notification to insert tape _before_ it is needed?, James Cort <=