mirror of https://github.com/digint/btrbk
btrbk: run_cmd: add large_output option (suppress stdout dump of command)
parent
03f7a8113d
commit
3cbcc74bc3
7
btrbk
7
btrbk
|
@ -728,6 +728,7 @@ sub run_cmd(@)
|
|||
my @cmd_pipe;
|
||||
my @unsafe_cmd;
|
||||
my $compressed = undef;
|
||||
my $large_output;
|
||||
my $stream_options = $cmd_pipe_in[0]->{stream_options} // {};
|
||||
my @filter_stderr;
|
||||
my $fatal_stderr;
|
||||
|
@ -744,6 +745,7 @@ sub run_cmd(@)
|
|||
$fatal_stderr = $href->{fatal_stderr} if($href->{fatal_stderr});
|
||||
$destructive = 1 unless($href->{non_destructive});
|
||||
$has_rsh = 1 if($href->{rsh});
|
||||
$large_output = 1 if($href->{large_output});
|
||||
|
||||
if($href->{check_unsafe}) {
|
||||
_safe_cmd($href->{check_unsafe}, \@unsafe_cmd);
|
||||
|
@ -859,7 +861,11 @@ sub run_cmd(@)
|
|||
chomp(@stderr = readline($err_fh));
|
||||
waitpid($pid, 0);
|
||||
if($do_trace) {
|
||||
if($large_output) {
|
||||
TRACE "Command output lines=" . scalar(@stdout) . " (large_output, not dumped)";
|
||||
} else {
|
||||
TRACE map("[stdout] $_", @stdout);
|
||||
}
|
||||
TRACE map("[stderr] $_", @stderr);
|
||||
}
|
||||
}
|
||||
|
@ -1257,6 +1263,7 @@ sub btrfs_subvolume_find_new($$;$)
|
|||
rsh => vinfo_rsh($vol),
|
||||
non_destructive => 1,
|
||||
filter_stderr => \&_btrfs_filter_stderr,
|
||||
large_output => 1,
|
||||
);
|
||||
unless(defined($ret)) {
|
||||
ERROR "Failed to fetch modified files for: $vol->{PRINT}", @stderr;
|
||||
|
|
Loading…
Reference in New Issue