initial commit of file from CVS for e-smith-backup on Thu 26 Oct 11:24:24 BST 2023
This commit is contained in:
22
root/etc/e-smith/events/actions/eject-tape
Normal file
22
root/etc/e-smith/events/actions/eject-tape
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
package esmith;
|
||||
|
||||
use strict;
|
||||
use esmith::ConfigDB;
|
||||
|
||||
my $event = shift;
|
||||
my $cause = shift;
|
||||
exit 0 if not defined $cause or $cause ne "tape";
|
||||
|
||||
my $confdb = esmith::ConfigDB->open_ro;
|
||||
my $backup = $confdb->get('backup') or die "No backup db entry found\n";
|
||||
my $device = $backup->prop('Device') || '/dev/st0';
|
||||
my $eject = $backup->prop('Eject') || 'no';
|
||||
|
||||
exit 0 unless $device =~ /[sh]t/;
|
||||
|
||||
if (lc($eject) eq 'yes') {
|
||||
exec("/bin/mt", "-f", $device, "eject");
|
||||
die("A problem occurred execing mt");
|
||||
}
|
Reference in New Issue
Block a user