Bacula-users

[Bacula-users] Run After - end of all jobs with changer device

2008-11-25 01:51:27
Subject: [Bacula-users] Run After - end of all jobs with changer device
From: Craig White <craigwhite AT azapple DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 24 Nov 2008 23:48:03 -0700
The itch I'm trying to scratch is to get the tape that was just used
parked back into the magazine after the last job has run so that if
someone changes the tapes in the magazines, there's no tapes still in
the drive but they are all parked back into the magazine.

I'm looking for a way to accomplish this that reliably works.

(by the way, the RPM installation, /usr/sbin/bconsole had privileges 754
which meant that user 'bacula' could not run bconsole in a script until
I gave the 'o' user execute privileges...I don't know if that is
intentional)

Thus my last job 'Run After' script looks like this...

#! /bin/sh
#
# cleans up sql dump that was backed up
#
/etc/bacula/delete_catalog_backup
#
# Sends command to Bacula bcsonsole to unmount tape and park it into
magazine
#
/usr/sbin/bconsole -c /etc/bacula/bconsole.conf <<END_OF_DATA
unmount storage=LTO-3
quit
END_OF_DATA
exit 0

but this failed  ;-(

24-Nov 21:53 SRV-ADV JobId 95: AfterJob: run command
"/etc/bacula/end_of_backup.sh"
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: Connecting to Director
srv-adv.mydomain.com:9101
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: 1000 OK: SRV-ADV Version: 2.4.3
(10 October 2008)
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: Enter a period to cancel a
command.
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: unmount storage=LTO-3
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: Automatically selected Catalog:
MyCatalog
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: Using Catalog "MyCatalog"
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: 3301 Issuing autochanger
"loaded? drive 0" command.
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: 3302 Autochanger "loaded? drive
0", result is Slot 9.
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: 3307 Issuing autochanger
"unload slot 9, drive 0" command.
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: 3995 Bad autochanger "unload
slot 9, drive 0": ERR=Child exited with code 1
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: Results=Unloading drive 0 into
Storage Element 9...mtx: Request Sense: Long Report=yes
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: Valid
Residual=no
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: Error
Code=70 (Current)
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: Sense
Key=Illegal Request
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: FileMark=no
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: EOM=no
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: ILI=no
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: Additional
Sense Code = 53
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: Additional
Sense Qualifier = 03
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Request Sense: BPV=no
24-Nov 21:53 SRV-ADV JobId 95: AfterJob: mtx: Req3901 Device
"Drive-1" (/dev/nst0) is already unmounted.

and my device status...
Device status:
Autochanger "LTO-3" with devices:
   "Drive-1" (/dev/nst0)         
   "Drive-2" (/dev/nst0)         
   "Drive-3" (/dev/nst0)         
   "Drive-4" (/dev/nst0)         
   "Drive-5" (/dev/nst0)         
   "Drive-6" (/dev/nst0)         
   "Drive-7" (/dev/nst0)         
   "Drive-8" (/dev/nst0)         
   "Drive-9" (/dev/nst0)         
   "Drive-10" (/dev/nst0)        
   "Drive-11" (/dev/nst0)        
   "Drive-12" (/dev/nst0)        
   "Drive-13" (/dev/nst0)        
   "Drive-14" (/dev/nst0)        
   "Drive-15" (/dev/nst0)        
Device "FileStorage" (/tmp) is not open.
Device "Drive-1" (/dev/nst0) is not open.
    Device is BLOCKED. User unmounted.   
    Drive 0 status unknown.              
Device "Drive-2" (/dev/nst0) is mounted with:
    Volume:      000001L3                    
    Pool:        MondayPool                  
    Media type:  LTO-3                       
    Slot 9 is loaded in drive 0.             
    Total Bytes=17,993,751,552 Blocks=278,920 Bytes/block=64,512
    Positioned at File=20 Block=0                               
Device "Drive-3" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-4" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-5" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-6" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-7" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-8" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-9" (/dev/nst0) is not open.                       
    Slot 6 is loaded in drive 0.                                
Device "Drive-10" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
Device "Drive-11" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
Device "Drive-12" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
Device "Drive-13" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
Device "Drive-14" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
Device "Drive-15" (/dev/nst0) is not open.                      
    Slot 6 is loaded in drive 0.                                
====                                                            

Used Volume status:
000001L3 on device "Drive-2" (/dev/nst0)
    Reader=0 writers=0 devres=0 volinuse=0
====                                      

Craig


-------------------------------------------------------------------------
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>
  • [Bacula-users] Run After - end of all jobs with changer device, Craig White <=