Linux – Bacula tape changing

backupbaculalinuxtape

How can I get Bacula to move the tape to the IO slot after it has ran a specific job?

I run daily backups with Bacula since a couple of days and I was wondering if I can do this kind of thing.
I've already specified the UseVolumeOnce = yes directive in the configuration files, but now I want to know if I can make Bacula move the tape to slot 24 (I/O slot) when the job finishes.

Can bacula do this or do I need to script it? If I need to script it, do you have experience with that?

Best Answer

Without having the same environment to test with, I'm not certain this will work, but a script like this called via the RunAfterJob directive in bacula-dir.conf should work:

#!/bin/sh
#
echo "unmount <device-name>" | <bacula-path>/bconsole -c bconsole.conf

If you want to avoid calling external scripts, you might experiment with the AlwaysOpen, RequiresMount/MountCommand/UnmountCommand, and/or OfflineOnUnmount directives. All of these are in the Device resource of your Storage Daemon configuration.

Also, can you clarify why this is desirable for you? Perhaps there's a solution to the root problem we're overlooking.