initial commit of file from CVS for e-smith-backup on Thu 26 Oct 11:24:24 BST 2023

This commit is contained in:
2023-10-26 11:24:24 +01:00
parent bb6b15a5a9
commit fe41ccadec
81 changed files with 9900 additions and 2 deletions

View 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");
}