From 41e3fbe815a074a3d55c9c46564a8f0c642c3d38 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 12 Aug 2016 13:19:23 +0200 Subject: borg-restore.pl: WIP Signed-off-by: Florian Pritz --- borg-restore.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/borg-restore.pl b/borg-restore.pl index f88fa1a..0a50578 100755 --- a/borg-restore.pl +++ b/borg-restore.pl @@ -96,7 +96,7 @@ sub find_archives { my @ret; #debug(sprintf("Found %d archive(s) with the following times for %s", @$modtimes+0, $path)); - debug(Dumper($modtimes)); + debug("All modification times from the database:\n", Dumper($modtimes)); debug("Building archive list"); @@ -133,7 +133,7 @@ sub select_archive { for my $archive (@$archives) { my $dt = DateTime->from_epoch(epoch => $archive->{modification_time}); - printf "\e[0;33m%d: \e[1;33m%s\e[0m %s\n", $counter++, $dt->strftime("%a. %F %H:%M:%S"), $archive->{archive}; + printf "\e[0;33m%3d: \e[1;33m%s\e[0m %s\n", $counter++, $dt->strftime("%a. %F %H:%M:%S"), $archive->{archive}; } printf "\e[0;34m%s: \e[0m", "Enter ID to restore (Enter to skip)"; @@ -255,8 +255,6 @@ sub handle_removed_archives { while (my ($path, $data) = each %db) { # TODO remove archive indexes all at once if (@$data > 0) { - #print Dumper($path, 0+@$data, $data, $archives); - # TODO should probably store 0 instead of undef for unset values assert($archive_index >= 0) if DEBUG; assert($archive_index < @$data) if DEBUG; splice @$data, $archive_index, 1; @@ -382,7 +380,6 @@ sub build_archive_cache { mkpath(get_cache_dir(), {mode => 0700}); if (-f $db_path) { - # TODO run this only when the database will actually be changed? debug("Creating temporary database copy"); cp($db_path, $db_path_tmp) or die "Failed to create temporary database copy: $!"; } -- cgit v1.2.3-24-g4f1b