From dd8d9e37a12005ef0cafd4ddb427b0744dc2f395 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 18 Jun 2021 13:24:06 -0700 Subject: [PATCH] check_large_files: adjust file compression to better suit APU2s, add progress indicator Signed-off-by: Jed Reynolds --- check_large_files.bash | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/check_large_files.bash b/check_large_files.bash index 6c746144..888f6695 100755 --- a/check_large_files.bash +++ b/check_large_files.bash @@ -460,13 +460,17 @@ compress_report_data() { note "compress report data..." cd /home/lanforge # local csvfiles=( $( find /home/lanforge -iname "*.csv" -print0 )) - while read f; do - (( $verbose > 0 )) && echo " compressing $f" - xz -7 "$f" - done < <(find html-reports/ lf_reports/ report-data/ tmp/ -type f \ - -a \( -name '*.csv' -o -name '*.pdf' -o -name '*.pdf' -o -name '*.pcap' -o -name '*.pcapng' \) ) + local vile_list=(`find html-reports/ lf_reports/ report-data/ tmp/ -type f \ + -a \( -name '*.csv' -o -name '*.pdf' -o -name '*.pdf' -o -name '*.pcap' -o -name '*.pcapng' \)`) + counter=1 + for f in "${vile_list[@]}"; do + (( $verbose > 0 )) && echo " compressing $f" || echo -n " ${counter}/${#vile_list[@]}" + nice xz -T0 -5 "$f" + (( counter+=1 )) + done totals[r]=0 cd - + echo "" } clean_var_tmp() {