1 |
diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar |
diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar |
2 |
--- e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2021-01-30 20:13:44.698955067 +0000 |
--- e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2021-02-09 21:26:24.961634134 +0000 |
3 |
+++ e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar 2021-01-30 20:18:00.982571819 +0000 |
+++ e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar 2021-02-09 21:29:49.256523741 +0000 |
4 |
@@ -31,6 +31,7 @@ |
@@ -31,6 +31,7 @@ |
5 |
use File::Glob qw(bsd_glob); |
use File::Glob qw(bsd_glob); |
6 |
use esmith::ConfigDB; |
use esmith::ConfigDB; |
81 |
- if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';} |
- if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';} |
82 |
- } |
- } |
83 |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
84 |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0, 1); |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0); |
85 |
|
|
86 |
- chomp $vollbl; |
- chomp $vollbl; |
87 |
- chomp $blkdev; |
- chomp $blkdev; |
111 |
|
|
112 |
sub removeTree |
sub removeTree |
113 |
diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup |
diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup |
114 |
--- e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup 2021-01-30 20:13:44.674956230 +0000 |
--- e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup 2021-02-09 21:26:24.926635870 +0000 |
115 |
+++ e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup 2021-01-30 20:17:32.531942610 +0000 |
+++ e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup 2021-02-09 21:29:21.581890670 +0000 |
116 |
@@ -27,6 +27,7 @@ |
@@ -27,6 +27,7 @@ |
117 |
use esmith::ConfigDB; |
use esmith::ConfigDB; |
118 |
use esmith::Backup; |
use esmith::Backup; |
141 |
- foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) { |
- foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) { |
142 |
- $udi =~ m/^(\S+)/; |
- $udi =~ m/^(\S+)/; |
143 |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
144 |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0, 1); |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0); |
145 |
|
|
146 |
- my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted); |
- my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted); |
147 |
- |
- |
225 |
- } |
- } |
226 |
+ |
+ |
227 |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
+ my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled'); |
228 |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0, 1); |
+ my ($valid, $invalid) = $devices->checkBackupDrives(0); |
229 |
+ |
+ |
230 |
+ if ( ${$valid}[0] ) { |
+ if ( ${$valid}[0] ) { |
231 |
+ foreach ( @{$valid} ) { |
+ foreach ( @{$valid} ) { |
262 |
} |
} |
263 |
|
|
264 |
sub bmount |
sub bmount |
|
diff -urN e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm e-smith-backup-2.6.0/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm |
|
|
--- e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm 2021-01-30 20:13:44.702954873 +0000 |
|
|
+++ e-smith-backup-2.6.0/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm 2021-01-30 20:16:39.613490616 +0000 |
|
|
@@ -200,7 +200,7 @@ |
|
|
# Return two arrays, valid drives, invalid drives |
|
|
sub checkBackupDrives |
|
|
{ |
|
|
- my ($self,$bsize) = @_; |
|
|
+ my ($self,$bsize,$removable) = @_; |
|
|
my @valid = (); |
|
|
my @invalid = (); |
|
|
$self->scanBlocks; # scan all block devices |
|
|
@@ -209,6 +209,7 @@ |
|
|
my $checks = 'UU RO FS'; # These checks are always valid |
|
|
$checks .= ' MO' if ($allowmount eq 'enabled'); |
|
|
$checks .= ' SZ' if ($bsize); # Only run the size check when a valid size is given |
|
|
+ $checks .= ' RM' if ($removable); # Only run the removable check if asked |
|
|
|
|
|
foreach my $drive (keys %{$hashref}) |
|
|
{ |
|
|
@@ -239,6 +240,10 @@ |
|
|
{ |
|
|
$hashref->{$drive}{REASON} .='MO ' if $self->mountpoint ($drive); last; |
|
|
} |
|
|
+ if (/^RM/si) # Non-removable |
|
|
+ { |
|
|
+ $hashref->{$drive}{REASON} .='RM ' unless $self->removable ($drive); last; |
|
|
+ } |
|
|
if (/^SZ/si) # filesystem size, this includes mounting to check free space |
|
|
{ |
|
|
$hashref->{$drive}{REASON} .='SZ ' if $self->checkBackupDriveSize ($drive, $bsize); |
|
|
@@ -360,13 +365,20 @@ |
|
|
return ($hashref->{$kname}{MODEL}); |
|
|
} |
|
|
|
|
|
+sub removable |
|
|
+{ |
|
|
+ my ($self,$kname) = @_; |
|
|
+ my $hashref = $self->{_blox}; |
|
|
+ return ($hashref->{$kname}{RM}) ? 1 : $EMPTY; |
|
|
+} |
|
|
+ |
|
|
# Given the KNAME return the label |
|
|
# returns 'no label' if none found |
|
|
sub label |
|
|
{ |
|
|
my ($self,$kname) = @_; |
|
|
my $hashref = $self->{_blox}; |
|
|
- return ($hashref->{$kname}{LABEL}) || gettext('no label'); |
|
|
+ return ($hashref->{$kname}{LABEL}) || gettext('nolabel'); |
|
|
} |
|
|
|
|
|
sub size |
|