From 6eab5a709d21f2d58b8f50773a7c34160fc2f5e7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 30 Mar 2019 15:05:55 -0400 Subject: [PATCH] make btrbk-run -pv be default --- btrbk-run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/btrbk-run b/btrbk-run index 87f5581..0c8dd8b 100755 --- a/btrbk-run +++ b/btrbk-run @@ -22,6 +22,10 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@" usage() { + cat <<'EOF' +btrbk-run [OPTIONS] +usually -t TARGET_HOST +EOF echo "top of script file:" sed -n '1,/^[# ]*end command line/{p;b};q' "$0" exit $1 @@ -37,10 +41,14 @@ mountpoints=() rsync_mountpoint=/q +# default options conf_only=false dry_run=false # mostly for testing rate_limit=no -verbose=false +verbose=true +if [[ $- == *i* ]]; then + progress_arg="--progress" +fi default_args_file=/etc/btrbk-run.conf if [[ -s $default_args_file ]]; then @@ -59,6 +67,7 @@ while true; do -m) IFS=, mountpoints=($2); unset IFS; shift 2 ;; -n) dry_run=true; dry_run_arg=-n; shift ;; -p) progress_arg="--progress"; shift ;; + -q) verbose=false; verbose_arg=; progress_arg=; shift ;; # target hosts to send to. empty is valid for just doing local # snapshot. we have default hosts we will populate. -t) IFS=, targets=($2); unset IFS; shift 2 ;; -- 2.30.2