X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;h=1ca6f57ab2d4092e0b98862caa0f6380113046ab;hb=ef708570f1f42d9bb54ddc5b7b0432de4f761eb0;hp=34b23a8af6a552d79672b55a0dc3b55b5cdc8186;hpb=e72acaee4cf7c394ca0e35b84d3afbd8ef5a4b32;p=distro-setup diff --git a/btrbk-run b/btrbk-run index 34b23a8..1ca6f57 100644 --- a/btrbk-run +++ b/btrbk-run @@ -474,9 +474,31 @@ log_path=/var/log/btrbk/$(date +%F_%T%:::z).log echo copying output to $log_path exec &> >(pee cat 'ts "%F %T"|dd of='$log_path' status=none') - +# print some non-default opts if $verbose; then - printf " options: conf_only=%s\ndry_run=%s\nrate_limit=%s\nverbose=%s\ncmd_arg=%s\n" "$conf_only" "$dry_run" "$rate_limit" "$verbose" "$cmd_arg" + opts_show=() + if ! $conf_only; then + opts_show+=(conf_only=true) + fi + if ! $dry_run; then + opts_show+=(dry_run=true) + fi + if [[ $rate_limit != no ]]; then + opts_show+=("rate_limit=$rate_limit") + fi + if [[ $cmd_arg != run ]]; then + opts_show+=(cmd_arg=$cmd_arg) + fi + if (( $opts_show >= 1 )); then + first=true + for opt in ${opts_show[@]}; do + if $first; then + printf "%s" "$opt" + else + printf " %s" "$opt" + done + echo + fi fi if [[ -v targets ]]; then @@ -490,8 +512,6 @@ fi echo "mountpoints: ${mountpoints[*]}" - - # pull_reexec stops us from getting into an infinite loop if there is some # kind of weird problem pulla=false