diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-08-12 13:19:23 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-08-12 13:19:23 +0200 |
commit | 41e3fbe815a074a3d55c9c46564a8f0c642c3d38 (patch) | |
tree | 207f63567967eae6dcf6f08c95fb7524b2b4c795 | |
parent | dfecf88f8181dc5078d0bc8fd8dd48301795d8cf (diff) | |
download | bin-41e3fbe815a074a3d55c9c46564a8f0c642c3d38.tar.gz bin-41e3fbe815a074a3d55c9c46564a8f0c642c3d38.tar.xz |
borg-restore.pl: WIP
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | borg-restore.pl | 7 |
1 files 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: $!"; } |