summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-08 21:10:52 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-08 21:10:52 +0200
commit7953b15584a18b199381a0d07712c1e916006715 (patch)
tree2e8831b5687ee329093e2b10daba798bfed3b3ad
parent76ca19ca5a2fd01720a0f47cf679de5aa30a2b07 (diff)
downloadbin-7953b15584a18b199381a0d07712c1e916006715.tar.gz
bin-7953b15584a18b199381a0d07712c1e916006715.tar.xz
borg-restore.pl: WIP, finally working now. just needs polish
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xborg-restore.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/borg-restore.pl b/borg-restore.pl
index 770c5da..fd0de1d 100755
--- a/borg-restore.pl
+++ b/borg-restore.pl
@@ -174,6 +174,13 @@ sub get_cache_path {
return get_cache_dir()."/$item";
}
+sub get_temp_path {
+ my $item = shift;
+
+ # FIXME securely create temp dir here!!!
+ return '/tmp/borg-restore-tmp'.$item;
+}
+
sub add_path_to_hash {
my $hash = shift;
my $path = shift;
@@ -316,7 +323,7 @@ sub save_database {
my $archives = shift;
my $db_path = get_cache_path('archives.db');
- my $db_path_tmp = get_cache_path('archives.db.tmp');
+ my $db_path_tmp = get_temp_path('archives.db.tmp');
my $db_path_new = get_cache_path('archives.db.new');
my $archive_cache = get_cache_path('archive_list');
my $archive_cache_tmp = get_cache_path('archive_list.tmp');
@@ -345,7 +352,7 @@ sub save_database {
sub build_archive_cache {
my $borg_archives = borg_list();
my $db_path = get_cache_path('archives.db');
- my $db_path_tmp = get_cache_path('archives.db.tmp');
+ my $db_path_tmp = get_temp_path('archives.db.tmp');
my $archive_cache = get_cache_path('archive_list');
my $archive_cache_tmp = get_cache_path('archive_list.tmp');
my $previous_archives = [];