S. Kremer wrote:

> can anyone tell me how to delete the label of ait4 tape at my autochanger?

Did you try google? All this information is in the (extensive) bacula 
manual. The first hit for 'bacula label' tells you how.

> I made the mistake to label each tape in the autochanger by the command label 
> media...
> Now, I know that i better used the console command label barcodes. But now 
> after I labeled the tapes manually I get the error messages "3920 Cannot 
> label Volume because it is already labeled: TestVolume1" if I run the command 
> label barcodes.
> 
> Can anyone help me to reset the labels of the tapes?

A quick script (with poor input validation and error handling) script to 
do it for every tape in the autochanger:

(yeah it's perl and it could easily have been done in bash, but I'm 
trying to finally get my perl skills up to a reasonable level, so 
practising it whenever I can ;)

[EMAIL PROTECTED]:/etc/bacula# cat weof.pl
#!/usr/bin/perl
use strict;
use warnings;

sub doWeof
{
         my $slot = shift;
         my $device = shift;
         print "doing Weof $slot\n";
         system("/usr/sbin/mtx -f /dev/$device load $slot");
         system("/bin/mt -f /dev/nst0 rewind");
         system("/bin/mt -f /dev/nst0 weof");
         system("/bin/mt -f /dev/nst0 rewind");
         system("/usr/sbin/mtx -f /dev/$device unload");
}

my $argc = @ARGV;

die("Wrong param") if ($argc != 1);

my $device = shift @ARGV;

open(my $filehandle, "-|", "/usr/sbin/mtx -f /dev/$device status");

while (<$filehandle>)
{
         if ( m/(\d+):Full/ )
         {
                 doWeof($1, $device);
         }

}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to