umount all unused backup dirs, cd into the used backup dir

This commit is contained in:
hjp 2015-09-05 23:38:54 +00:00
parent 99f174bd0d
commit d7446596d9
3 changed files with 31 additions and 26 deletions

View File

@ -4,7 +4,7 @@
"unknown" "unknown"
], ],
"dynamic_config" : 0, "dynamic_config" : 0,
"generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110440", "generated_by" : "Module::Build version 0.421",
"license" : [ "license" : [
"perl_5" "perl_5"
], ],
@ -16,9 +16,9 @@
"prereqs" : { "prereqs" : {
"runtime" : { "runtime" : {
"requires" : { "requires" : {
"Config::YAML" : 0, "Config::YAML" : "0",
"Digest::SHA" : 0, "Digest::SHA" : "0",
"Readonly" : 0 "Readonly" : "0"
} }
} }
}, },
@ -28,24 +28,19 @@
"version" : "0.002" "version" : "0.002"
}, },
"Simba::Build" : { "Simba::Build" : {
"file" : "lib/Simba/Build.pm", "file" : "lib/Simba/Build.pm"
"version" : 0
}, },
"Simba::CA" : { "Simba::CA" : {
"file" : "lib/Simba/CA.pm", "file" : "lib/Simba/CA.pm"
"version" : 0
}, },
"Simba::CA::DBI" : { "Simba::CA::DBI" : {
"file" : "lib/Simba/CA/DBI.pm", "file" : "lib/Simba/CA/DBI.pm"
"version" : 0
}, },
"Simba::DA" : { "Simba::DA" : {
"file" : "lib/Simba/DA.pm", "file" : "lib/Simba/DA.pm"
"version" : 0
}, },
"Simba::Util" : { "Simba::Util" : {
"file" : "lib/Simba/Util.pm", "file" : "lib/Simba/Util.pm"
"version" : 0
} }
}, },
"release_status" : "stable", "release_status" : "stable",

View File

@ -4,35 +4,30 @@ author:
- unknown - unknown
build_requires: {} build_requires: {}
dynamic_config: 0 dynamic_config: 0
generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110440' generated_by: 'Module::Build version 0.421, CPAN::Meta::Converter version 2.142690'
license: perl license: perl
meta-spec: meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4 version: '1.4'
name: Simba name: Simba
provides: provides:
Simba: Simba:
file: lib/Simba.pm file: lib/Simba.pm
version: 0.002 version: '0.002'
Simba::Build: Simba::Build:
file: lib/Simba/Build.pm file: lib/Simba/Build.pm
version: 0
Simba::CA: Simba::CA:
file: lib/Simba/CA.pm file: lib/Simba/CA.pm
version: 0
Simba::CA::DBI: Simba::CA::DBI:
file: lib/Simba/CA/DBI.pm file: lib/Simba/CA/DBI.pm
version: 0
Simba::DA: Simba::DA:
file: lib/Simba/DA.pm file: lib/Simba/DA.pm
version: 0
Simba::Util: Simba::Util:
file: lib/Simba/Util.pm file: lib/Simba/Util.pm
version: 0
requires: requires:
Config::YAML: 0 Config::YAML: '0'
Digest::SHA: 0 Digest::SHA: '0'
Readonly: 0 Readonly: '0'
resources: resources:
license: http://dev.perl.org/licenses/ license: http://dev.perl.org/licenses/
version: 0.002 version: '0.002'

View File

@ -81,4 +81,19 @@ unless ($backup_dir) {
} }
$ca->basedir($backup_dir); $ca->basedir($backup_dir);
# umount all potential backup dirs again, except the one we are actually
# using
for (@backup_dirs) {
next if $_->[0] eq $backup_dir;
$ca->log(0, "unmounting $_->[0]");
system("/bin/umount", $_->[0]);
}
chdir($backup_dir); # prevent accidental umount
$ca->run(); $ca->run();
# umount backup dir
chdir("/");
$ca->log(0, "unmounting $backup_dir");
system("/bin/umount", $backup_dir);