From d7446596d90e309cc9bf877875b4ce4c931ddb97 Mon Sep 17 00:00:00 2001 From: hjp Date: Sat, 5 Sep 2015 23:38:54 +0000 Subject: [PATCH] umount all unused backup dirs, cd into the used backup dir --- MYMETA.json | 23 +++++++++-------------- MYMETA.yml | 19 +++++++------------ scripts/backup | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/MYMETA.json b/MYMETA.json index 9f5d4f9..eddcb05 100644 --- a/MYMETA.json +++ b/MYMETA.json @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 0, - "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110440", + "generated_by" : "Module::Build version 0.421", "license" : [ "perl_5" ], @@ -16,9 +16,9 @@ "prereqs" : { "runtime" : { "requires" : { - "Config::YAML" : 0, - "Digest::SHA" : 0, - "Readonly" : 0 + "Config::YAML" : "0", + "Digest::SHA" : "0", + "Readonly" : "0" } } }, @@ -28,24 +28,19 @@ "version" : "0.002" }, "Simba::Build" : { - "file" : "lib/Simba/Build.pm", - "version" : 0 + "file" : "lib/Simba/Build.pm" }, "Simba::CA" : { - "file" : "lib/Simba/CA.pm", - "version" : 0 + "file" : "lib/Simba/CA.pm" }, "Simba::CA::DBI" : { - "file" : "lib/Simba/CA/DBI.pm", - "version" : 0 + "file" : "lib/Simba/CA/DBI.pm" }, "Simba::DA" : { - "file" : "lib/Simba/DA.pm", - "version" : 0 + "file" : "lib/Simba/DA.pm" }, "Simba::Util" : { - "file" : "lib/Simba/Util.pm", - "version" : 0 + "file" : "lib/Simba/Util.pm" } }, "release_status" : "stable", diff --git a/MYMETA.yml b/MYMETA.yml index edeaeaf..c6837f7 100644 --- a/MYMETA.yml +++ b/MYMETA.yml @@ -4,35 +4,30 @@ author: - unknown build_requires: {} 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 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Simba provides: Simba: file: lib/Simba.pm - version: 0.002 + version: '0.002' Simba::Build: file: lib/Simba/Build.pm - version: 0 Simba::CA: file: lib/Simba/CA.pm - version: 0 Simba::CA::DBI: file: lib/Simba/CA/DBI.pm - version: 0 Simba::DA: file: lib/Simba/DA.pm - version: 0 Simba::Util: file: lib/Simba/Util.pm - version: 0 requires: - Config::YAML: 0 - Digest::SHA: 0 - Readonly: 0 + Config::YAML: '0' + Digest::SHA: '0' + Readonly: '0' resources: license: http://dev.perl.org/licenses/ -version: 0.002 +version: '0.002' diff --git a/scripts/backup b/scripts/backup index 21d5f3f..1a50417 100755 --- a/scripts/backup +++ b/scripts/backup @@ -81,4 +81,19 @@ unless ($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(); + +# umount backup dir + +chdir("/"); +$ca->log(0, "unmounting $backup_dir"); +system("/bin/umount", $backup_dir);