Bacula-users

Re: [Bacula-users] Admin job and volume name?

2008-06-17 03:43:59
Subject: Re: [Bacula-users] Admin job and volume name?
From: Troy Daniels <troy.daniels AT itouch.com DOT au>
To: hjrrs AT yahoo DOT com
Date: Tue, 17 Jun 2008 15:44:46 +0800
Hi,

Hemant Shah wrote:
> Folks,
> 
>   I have setup Admin job that will change the status of volume to Used and 
> eject the tape it. I use variable substitution but my script does not get the 
> volume name.
> 

I dont think it's possible as Admin jobs dont have associated volumes as 
you are neither writing to nor reading from a volume.

You can either run the script as a 'Run After' job of your last backup 
(I do something similar by doing this with my Catalog Backup Job) or 
work out some scriptFU to determine the currently loaded volume name.

Thinking about it, you should be able to achieve this with a call to 
mtx-changer, however I'm not sure what the arguments would be off the 
top of my head.

Hope this helps,


Troy Daniels
Systems Admin.
iTouch Australia.


> Here is the setup:
> 
> Pool
> {
>   Name = FullBackupTapePool
>   Pool Type = Backup
>   Recycle = no                        # Bacula can automatically recycle 
> Volumes
>   AutoPrune = yes                     # Prune expired volumes
>   Volume Retention = 2 years          # two years
>   Maximum Volumes = 24
>   Storage = DLT_Drive
>   Label Format = "FullBackup-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}"
> }
> 
> 
> Job
> {
>    Name = RunAfterFullToTape
>    Type = Admin
>    Client = xxxxx-fd
>    FileSet = "Dummy Set"
>    Messages = Standard
>    Schedule = FullBackupToTape
>    Priority = 6
>    Pool = FullBackupTapePool
>    RunAfterJob = "/usr/local/etc/ChangeTapeStatusToUsed %v"
> }
> 
> When the script is executed, it does not get the volume name.
> 
> Here is my script:
> 
> #!/bin/ksh
> 
> if (( $# != 1 ))
> then
>    print "ERROR: Volume name not specified"
>    # exit with zero so bacula does not error out.
>    exit 0
> else
>    Volume=$1
> fi
> /bin/echo "update volume=$Volume volstatus=Used\nquit" \
>       | /usr/local/bin/bconsole -c /usr/local/etc/bconsole.conf
> 
> 
> /bin/echo "unmount DLT_Drive" | /usr/local/bin/bconsole
> /bin/mt -f /dev/st0 status | /bin/grep ONLINE > /dev/null 2> /dev/null
> Status=$?
> if (( $Status == 0 ))
> then
>    /bin/mt -f /dev/st0 rewoffl
> fi
> 
> # exit with zero so bacula does not error out.
> exit 0
> 
> 
> How do I pass volume label to the script?
> 
> Thanks.
> 
> 
> Hemant Shah
> E-mail: hjrrs AT yahoo DOT com
> 
> 
>       
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
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>