Bacula-users

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

2008-06-16 16:49:10
Subject: Re: [Bacula-users] Admin job and volume name?
From: Ulrich Leodolter <ulrich.leodolter AT obvsg DOT at>
To: hjrrs AT yahoo DOT com
Date: Mon, 16 Jun 2008 22:48:52 +0200
On Mon, 2008-06-16 at 08:54 -0700, 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.
> 
> 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
> 

try echo "echo -e ..."

man echo
....
 -e     enable interpretation of backslash escapes


> 
> /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>