So I've had some time to test a few things, and it looks like this is the command that Bacula is sending to see which tape is loaded:
/var/lib/bacula/mtx-changer /dev/sg1 loaded 0 /dev/nst0 0 And, assuming it answers with 12 for slot 12, it ejects the tape using: /var/lib/bacula/mtx-changer /dev/sg1 unload 12 /dev/nst0 0 That seems to work okay, except that Bacula sort of stumbles around afterwards, during the next backup or restore. I've copied part of the log below, but it basically sits there for 5 minutes, until it times out I'm guessing, before it realizes that the tape has been ejected. It then times out for another 5 minutes before it tries to load the tape it needs. So, it looks like it would still be preferable to run some command inside Bacula to eject the tape so that it knows about the ejection, rather than going through the external script. This might be a question for the developers, but is there a simple way to do that? I'm still combing the manual, but haven't found anything relevant yet. Log snip: 19-Sep 14:21 ns2-dir: Start Restore Job RestoreFiles.2006-09-19_14.20.59 19-Sep 14:26 ns2-sd: RestoreFiles.2006-09-19_14.20.59 Warning: Couldn't rewind device /dev/nst0 ERR=dev.c:406 Rewind error on /dev/nst0. ERR=Input/output error. 19-Sep 14:26 ns2-sd: 3301 Issuing autochanger "loaded drive 0" command. 19-Sep 14:26 ns2-sd: 3302 Autochanger "loaded drive 0", result: nothing loaded. 19-Sep 14:31 ns2-sd: 3304 Issuing autochanger "load slot 4, drive 0" command. 19-Sep 14:32 ns2-sd: 3305 Autochanger "load slot 4, drive 0", status is OK. 19-Sep 14:32 ns2-sd: Ready to read from volume "AAA003L2" on device /dev/nst0. 19-Sep 14:32 ns2-sd: Forward spacing to file:block 114:0. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Koppel Sent: Monday, September 11, 2006 11:05 To: bacula-users@lists.sourceforge.net Subject: [Bacula-users] FW: Autoloader: Replace tape in magazine after backups complete? Actually, as a result of my testing last week with umount, my weekend backups didn't run; umount only logically unmounted the tape, and then Bacula sat there waiting for someone to manually (logically) remount the tape. And the manual actually says: If you have an autoloader, the mount command will not cause Bacula to operate the autoloader. Which is, I guess, what I need. Bacula is operating the autoloader for the actual backup, it just keeps the tape in the drive when the backup is finished. It looks like it's calling a program, mtx-changer, to do the actual magic, so I'm going to experiment with that once my weekend backups have completed. --Jeremy -----Original Message----- From: Ryan Novosielski [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 10:21 To: Jeremy Koppel Subject: Re: [Bacula-users] Autoloader: Replace tape in magazine after backups complete? Those aren't commands. Commands are those that appear in the list when one types "help." Try 'umount' and see what the next step in the script should be. All you're looking to do is write a sequence of console commands -- no different than running them at the console. If you don't know what the console commands are, read the manual. Jeremy Koppel wrote: > I see your point. When I look through the Bacula logs, I see stuff like > this: > > > > 02-Sep 01:02 ns2-sd: 3301 Issuing autochanger "loaded drive 0" command. > > 02-Sep 01:02 ns2-sd: 3302 Autochanger "loaded drive 0", result is Slot 1. > > 02-Sep 01:02 ns2-sd: 3303 Issuing autochanger "unload slot 1, drive 0" > command. > > > > But typing loaded drive 0 or autochanger "loaded drive 0" or other > various variants into the Bacula console just gives errors like ____ is > an illegal command. What do I need to do to actually get those commands > to work? > > > > -----Original Message----- > From: Ryan Novosielski [mailto:[EMAIL PROTECTED] > Sent: Friday, September 08, 2006 15:15 > To: Jeremy Koppel > Cc: bacula-users@lists.sourceforge.net > Subject: Re: [Bacula-users] Autoloader: Replace tape in magazine after > backups complete? > > > > Nope. My guess is the zero has to do with autochanger slots. > > > > Important to keep in mind here is that all this is doing is running > > commands on the console. If umount [CR] 0 [CR] q [CR] doesn't work in > > the console, it's not going to work here either. > > > > I don't have an autoloader, so I don't know how prompting for them > > works. In any case, I'd still recommend a more specific "umount > > <storangename>" line -- good to be as specific as possible. > > > > =R > > > > Jeremy Koppel wrote: > >> Mark, Arno, > >> > >> > >> > >> Thanks much for the replies. For my Gentoo installation, here's > >> what I get: > >> > >> > >> > >> ns2 ns1 # echo -e "umount\n0\nq\n" | /var/lib/bacula/bconsole -c > >> /etc/bacula/bconsole.conf > >> > >> Connecting to Director ns2:9101 > >> > >> 1000 OK: ns2-dir Version: 1.36.3 (22 April 2005) > >> > >> Enter a period to cancel a command. > >> > >> umount > >> > >> Using default Catalog name=MyCatalog DB=bacula > >> > >> Automatically selected Storage: Autoloader > >> > >> 3002 Device /dev/nst0 unmounted. > >> > >> 0 > >> > >> 0: is an illegal command. > >> > >> q > >> > >> ns2 ns1 # > >> > >> > >> > >> Am I supposed to substitute 'n' for something? > >> > >> > >> > >> --Jeremy > >> > >> > >> > >> > >> > >> -----Original Message----- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> Sent: Thursday, September 07, 2006 17:24 > >> To: Jeremy Koppel > >> Cc: bacula-users@lists.sourceforge.net > >> Subject: Re: [Bacula-users] Autoloader: Replace tape in magazine after > >> backups complete? > >> > >> > >> > >> > >> > >> > >> > >> In the message dated: Thu, 07 Sep 2006 16:55:15 EDT, > >> > >> The pithy ruminations from "Jeremy Koppel" on > >> > >> <[Bacula-users] Autoloader: Replace tape in magazine after backups > >> complete?> w > >> > >> ere: > >> > >> > >> > >> => > >> > >> => Well, we just had an autoloader go bad on us. Quantum sent us a new > >> > >> > >> > >> Ouch. > >> > >> > >> > >> => chassis under warranty, but there was a tape in the drive when the unit > >> > >> => tanked out on us. There's no way to get at it manually, and no user > >> > >> => serviceable parts. They tell me that the only way to get it out is by > >> > >> => disassembling the drive, which they'll do, but the process destroys the > >> > >> => tape. > >> > >> > >> > >> Oh, that's bad. I've got the same thing with a long-out-of-warranty AIT2 > >> > >> changer. > >> > >> > >> > >> => > >> > >> => > >> > >> => > >> > >> => So, I'm thinking it would be best to have Bacula replace whatever tape > >> > >> => it's using back in the autoloader when the last job of the night runs. > >> > >> => Anybody know how I'd configure that? > >> > >> > >> > >> Sure. Assuming that your last backup job is to backup the Bacula catalog > >> > >> database, and that there's a RunAfter directive that executes a script > >> > >> like $BACULA/bin/delete_catalog_backup, I add to that script something > >> > >> like: > >> > >> > >> > >> ################################################ > >> > >> /bin/echo -e "umount\n0\nq\n" | $BACULA/bin/bconsole -c > >> $BACULA/etc/bconsole.conf > >> > >> ################################################ > >> > >> > >> > >> This will send the umount command to the Bacula bconsole program. > >> Substitute > >> > >> the correct path for your Bacula installation, and repeat the "umount" > >> command > >> > >> for each of the tape drives within the autochanger (specifying the drive > >> > >> number). > >> > >> > >> > >> Mark > >> > >> > >> > >> => > >> > >> => > >> > >> => > >> > >> => Thanks! > >> > >> => > >> > >> => > >> > >> => > >> > >> => --Jeremy Koppel > >> > >> => > >> > >> => > >> > >> => > >> > >> => > >> > >> => ------_=_NextPart_1655_00025162.00015147 > >> > >> => Content-Type: text/html; > >> > >> => charset="us-ascii" > >> > >> => Content-Transfer-Encoding: quoted-printable > >> > >> => > >> > >> => <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" > >> xmlns:w=3D"urn:sc= > >> > >> => hemas-microsoft-com:office:word" > >> xmlns=3D"http://www.w3.org/TR/REC-html40"> > >> > >> => > >> > >> [Gack! Horrible MS-Word HTML deleted] > >> > >> > >> > >> ---- > >> > >> Mark Bergman [EMAIL PROTECTED] > >> > >> System Administrator > >> > >> Section of Biomedical Image Analysis 215-662-7310 > >> > >> Department of Radiology, University of Pennsylvania > >> > >> > >> > >> http://pgpkeys.pca.dfn.de:11371/pks/lookup?search=mark.bergman%40.uphs.u penn.edu > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> The information contained in this e-mail message is intended only for > >> the personal and confidential use of the recipient(s) named above. If > >> the reader of this message is not the intended recipient or an agent > >> responsible for delivering it to the intended recipient, you are hereby > >> notified that you have received this document in error and that any > >> review, dissemination, distribution, or copying of this message is > >> strictly prohibited. If you have received this communication in error, > >> please notify us immediately by e-mail, and delete the original message. > >> > >> > >> ------------------------------------------------------------------------ > >> > >> ------------------------------------------------------------------------ - > >> Using Tomcat but need to do more? Need to support web services, security? > >> Get stuff done quickly with pre-integrated technology to make your job > easier > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > >> > >> > >> ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> Bacula-users mailing list > >> Bacula-users@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/bacula-users > > > > -- > > ---- _ _ _ _ ___ _ _ _ > > |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer III > > |$&| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) > > \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 > > > > > -- ---- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer III |$&| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 ------------------------------------------------------------------------ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users