diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-08-02 14:20:17 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-08-02 14:20:17 +0200 |
commit | 8d1dc148fa2c0bb70993651554de7e7ebc34d9ba (patch) | |
tree | 177b5350f213263f77b3156853c527cbd089e31e /script | |
parent | b575355ace040a580d08338caa810230cb508e0c (diff) | |
download | App-BorgRestore-8d1dc148fa2c0bb70993651554de7e7ebc34d9ba.tar.gz App-BorgRestore-8d1dc148fa2c0bb70993651554de7e7ebc34d9ba.tar.xz |
Add --quiet
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'script')
-rwxr-xr-x | script/borg-restore.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/script/borg-restore.pl b/script/borg-restore.pl index dcf6166..24dd735 100755 --- a/script/borg-restore.pl +++ b/script/borg-restore.pl @@ -13,6 +13,7 @@ borg-restore.pl [options] <path> Options: --help, -h short help message --debug show debug messages + --quiet show only warnings and errors --update-cache, -u update cache files --list [pattern] List paths contained in the backups, optionally matching an SQLite LIKE pattern @@ -71,6 +72,10 @@ Show help message. Enable debug messages. +=item B<--quiet> + +Reduce output by showing only show warnings and above (errors). + =item B<--update-cache>, B<-u> Update the lookup database. You should run this after creating or removing a backup. @@ -219,7 +224,7 @@ sub main { $ENV{PATH} = App::BorgRestore::Helper::untaint($ENV{PATH}, qr(.*)); Getopt::Long::Configure ("bundling"); - GetOptions(\%opts, "help|h", "debug", "update-cache|u", "destination|d=s", "time|t=s", "adhoc", "version", "list") or pod2usage(2); + GetOptions(\%opts, "help|h", "debug", "update-cache|u", "destination|d=s", "time|t=s", "adhoc", "version", "list", "quiet") or pod2usage(2); pod2usage(0) if $opts{help}; if ($opts{version}) { @@ -229,6 +234,11 @@ sub main { pod2usage(-verbose => 0) if (@ARGV== 0 and !$opts{"update-cache"} and !$opts{"list"}); + if ($opts{quiet}) { + my $logger = Log::Log4perl->get_logger(''); + $logger->level($WARN); + } + if ($opts{debug}) { my $logger = Log::Log4perl->get_logger(''); $logger->level($DEBUG); |