Hi, Thanks for you reply. I made my own script based on yours and I added stuff to set inchanger flag to no for all volumes.
Here is the script : #!/bin/sh /usr/bin/bconsole -c /etc/bacula/bconsole.conf <<END_OF_DATA unmount storage=Autochanger drive=0 unmount storage=Autochanger drive=1 mount storage=Autochanger drive=0 mount storage=Autochanger drive=1 END_OF_DATA temp=`mktemp` for vol in `echo 'list media' | bconsole -c /etc/bacula/bconsole.conf | grep '^|[[:space:]]\+[0-9]\+' | awk -F'|' '{ print $3 }' | sed 's![^0-9]!!g'`; do echo "update volume=${vol} inchanger=no" >> ${temp} done cat ${temp} | bconsole -c /etc/bacula/bconsole.conf rm ${temp} And bacula-dir.conf : Job { Name = "Eject-tapes" Type = admin Client = srv-mpp-lrs-fd Messages = Standard Storage = Autochanger Pool = Weekly, Daily FileSet = "Dummy" RunBeforeJob = "/etc/bacula/scripts/eject_tapes" Priority = 99 } FileSet { Name = "Dummy" } It seems to do the job for now ! Thomas Sturm a écrit : > Hello Adam, > that is what I do: > > I have an admin-Job: > Job { > Name = "unload_tape" > Type = admin > Client = bacula-fd > JobDefs = "backup" > FileSet="Catalog" > RunBeforeJob = "/usr/libexec/bacula/unload_tape" > Schedule = "nachts" > Priority = 99 # > } > > /usr/libexec/bacula/unload_tape: > #!/bin/bash > /usr/sbin/bconsole -c /etc/bacula/bconsole.conf <<END_OF_DATA > unmount storage=DLT-S4 > unmount storage=X > unmount storage=Y > END_OF_DATA > > sleep 120 > > /usr/sbin/bconsole -c /etc/bacula/bconsole.conf <<END_OF_DATA > mount storage=DLT-S4 > mount storage=X > mount storage=Y > END_OF_DATA > > In the morning, I only have to collect the tapes from the library :-) > > regards > Thomas > > Am Montag, 14. Mai 2007 09:40 schrieb Adam Cécile: > >> Hi, >> >> All weeks I need to unload all tapes from drives to the library, so all >> tapes can be removed from the Autochanger easily. >> However, when I do "umount", device is marked as BLOCKED and no more >> jobs run until I mount the drive again. >> What's the right way to eject all tapes without blocking drives ? >> >> Thanks in advance. >> >> >> ##################### bacula-dir.conf >> # Autochanger Dell PV132T (21x LTO3) >> Storage { >> Name = Autochanger >> Address = srv-mpp-lrs >> SDPort = 9103 >> Password = "ZK9nC86vuFvW80l28xQ3jaKtEJt89jXM3R31VjdZl" >> Device = Dell-PV132T >> Media Type = LTO3 >> Autochanger = yes >> Maximum Concurrent Jobs = 2 >> } >> >> ##################### bacula-sd.conf >> # An autochanger device with two drives >> Autochanger { >> Name = Dell-PV132T >> Device = ULTRIUM-TD3-1 >> Device = ULTRIUM-TD3-2 >> Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d" >> Changer Device = /dev/sg2 >> } >> Device { >> Name = ULTRIUM-TD3-1 >> Drive Index = 0 >> Media Type = LTO3 >> Archive Device = /dev/nst0 >> AutomaticMount = yes; # when device opened, read it >> AlwaysOpen = yes; >> RemovableMedia = yes; >> Offline On Unmount = no; >> #RandomAccess = no; >> AutoChanger = yes >> # Enable the Alert command only if you have the mtx package loaded >> # Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'" >> } >> Device { >> Name = ULTRIUM-TD3-2 >> Drive Index = 1 >> Media Type = LTO3 >> Archive Device = /dev/nst1 >> AutomaticMount = yes; # when device opened, read it >> AlwaysOpen = yes; >> RemovableMedia = yes; >> Offline On Unmount = no; >> #RandomAccess = no; >> AutoChanger = yes >> # Enable the Alert command only if you have the mtx package loaded >> # Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'" >> } >> -- Adam CECILE Linbox / Free&ALter Soft 152 rue de Grigy tél: +33 3 87 50 87 95 Technopôle Metz 2000 fax: +33 3 87 75 19 26 57070 METZ - France http://www.linbox.com ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users