summaryrefslogtreecommitdiffstats
path: root/lib/App/BorgRestore/DB.pm
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-11-22 11:17:43 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-11-22 11:26:58 +0100
commit0db2d2145810e93801dd77f5f016647a606e1f73 (patch)
tree2f62056e36e39d5604c39811a4c9921603265f26 /lib/App/BorgRestore/DB.pm
parentb7d10e6a9dfe7851479e6948b92c72f240555497 (diff)
downloadApp-BorgRestore-0db2d2145810e93801dd77f5f016647a606e1f73.tar.gz
App-BorgRestore-0db2d2145810e93801dd77f5f016647a606e1f73.tar.xz
Create cache directory in DB instead of Settings
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/BorgRestore/DB.pm')
-rw-r--r--lib/App/BorgRestore/DB.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/App/BorgRestore/DB.pm b/lib/App/BorgRestore/DB.pm
index 35975d6..0bc5214 100644
--- a/lib/App/BorgRestore/DB.pm
+++ b/lib/App/BorgRestore/DB.pm
@@ -9,6 +9,7 @@ use autodie;
use DBI;
use Function::Parameters;
use Log::Any qw($log);
+use Path::Tiny;
=encoding utf-8
@@ -27,6 +28,9 @@ method new($class: $db_path, $cache_size) {
bless $self, $class;
if (! -f $db_path) {
+ # ensure the cache directory exists
+ path($db_path)->parent->mkpath({mode => oct(700)});
+
my $db = $self->_open_db($db_path, $cache_size);
$self->initialize_db();
} else {