Bacula-users

Re: [Bacula-users] Volume retention issues

2008-04-16 13:45:11
Subject: Re: [Bacula-users] Volume retention issues
From: Brian Debelius <bdebelius AT intelesyscorp DOT com>
To: Timo Neuvonen <timo-news AT tee-en DOT net>
Date: Wed, 16 Apr 2008 13:44:47 -0400
Timo Neuvonen wrote:
> I've sometimes wished a way to explicitly force start using a new volume 
> (ie. marking the previous one "used") when a certain full backup job is run. 
> This way, the previous volume would be ready for recycling earlier. Could 
> someone advice if there is a decent way to do this? External run-before-job 
> scripting does not sound nice for this purpose. And playing with volume use 
> duration falls too easily out-of sync with jobs run.
>
>
> Regards,
> Timo 
>   
I run an admin job that marks the last tape that has been written to, as 
used.

adminjob.cmd
@echo off

set bconsole_prog="C:\Program Files\Bacula\bin\bconsole.exe"
set bconsole_cfg="C:\Program Files\Bacula\etc\bconsole.conf"
set bconsole=%bconsole_prog% -c %bconsole_cfg%
set mtx="C:\Program Files\Bacula\bin\mtx.exe"
set mt="C:\Program Files\Bacula\bin\mt.exe"
set working_dir=c:\program files\bacula\var\work


if (%1) == (MarkAsUsed)  goto _MarkAsUsed
if (%1) == (ReleaseTape) goto _ReleaseTape
if (%1) == (UpdateSlots) goto _UpdateSlots

echo Should not be here.
goto _END

:_MarkAsUsed
set tempfile="%working_dir%\adminjob.tmp"

%mtx% -f Changer0 status > %tempfile%
for /F "usebackq tokens=10" %%i in ( `findstr /R /C:"^Data Transfer 
Element 0:Full" %tempfile%` ) do set inchanger=%%i

echo update volume=%inchanger% volstatus=used quit | %bconsole%
goto _End

:_ReleaseTape
echo release storage=Tape quit | %bconsole%
goto _End

:_UpdateSlots
echo update slots storage=Tape quit | %bconsole%
goto _End



##########################
# MarkTapeAsUsed
##########################
Job {
  Name    = MarkTapeAsUsed
  Type    = Admin
  Level    = Full
  Client    = elkton-fd
  Fileset    = None
  Messages    = Standard
  Schedule    = Daily_Backup
  Pool    = Tape-daily
  Spool Data= no
  Priority    = 100
  RunBeforeJob = "\"c:/program files/bacula/bin/adminjob.cmd\" MarkAsUsed"


:_END
Rem Exit




-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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>