Here’s a little script I whipped up in perl to sequentially load and erase all the tapes in an auto loader. Hopefully it is of some use to others.
payday loans low interest unsecured personal loans apply online multiple lenders personal loans no fax no call payday loans no fax cash til payday loans cash advances online fast payday loans no credit check loans bad credit personal loans no credit check no turndown personal loans cash advance service payday loans free bad credit personal loans fast cash bad credit personal loans instant bad credit personal loans bad credit payday loans bad credit no fax payday loans instant no faxing payday loans apply online for personal loans hard money lenders for personal loans bad credit high risk unsecured personal loans no credit check same day personal loans bad credit debt personal loans
#!/usr/bin/perl
$num_slots = “20″;
$changer_device = “/dev/changer”;
$tape_device = “/dev/st0″;
$settle_time = “120″;
while ($_ < $num_slots) {
$_ += 1;
print “Loading tape from slot $_…\n”;
`mtx -f $changer_device load $_`;
print “Letting tape drive settle…\n”;
`sleep $settle_time`;
print “Rewinding tape…\n”;
`mt -f $tape_device rewind`;
print “Writing EOF to tape…\n”;
`mt -f $tape_device weof`;
print “Unloading tape…\n”;
`mtx -f $changer_device unload $_`;
print “Done!\n———-\n”;
}
This entry was posted
on Thursday, June 21st, 2007 at 3:35 pm and is filed under Code, Linux, Perl.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.