summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-23 15:51:37 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-23 15:54:11 +0100
commitd840d8559c4ef4493bad6239ab6ab69d93ff1464 (patch)
tree4aabd749e1a6b0ecb9993c9778dede8f8b64517f
parentc5bef36bfa010b9a958497df455ea6e7ba08b22e (diff)
downloadApp-BorgRestore-d840d8559c4ef4493bad6239ab6ab69d93ff1464.tar.gz
App-BorgRestore-d840d8559c4ef4493bad6239ab6ab69d93ff1464.tar.xz
No longer automatically enable --adhoc when cache is empty
Users with many backups may not spot the warning because it is above their backup list and they may think that the cache doesn't work because the list is so long. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--Changes1
-rwxr-xr-xscript/borg-restore.pl7
2 files changed, 5 insertions, 3 deletions
diff --git a/Changes b/Changes
index a46f8bc..22043d6 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for Perl extension App-BorgRestore
{{$NEXT}}
+ - No longer automatically enable --adhoc when cache is empty
2.3.0 2018-02-06T15:58:36Z
- Add --list option to search for paths occuring in backups
diff --git a/script/borg-restore.pl b/script/borg-restore.pl
index a2df4a5..dcf6166 100755
--- a/script/borg-restore.pl
+++ b/script/borg-restore.pl
@@ -258,9 +258,10 @@ sub main {
return 0;
}
- if (!$app->cache_contains_data()) {
- $opts{"adhoc"} = 1;
- $log->warning("Cache is empty. --adhoc has been enabled for you automatically");
+ if (!$app->cache_contains_data() && !$opts{adhoc}) {
+ $log->error("Cache is empty. Either the cache path is incorrect or you did not run --update yet.");
+ $log->error("If you did not create a cache yet, you may want to rerun with --adhoc to simply list all backups.");
+ return 1;
}
my @paths = @ARGV;