various fixes, internal mail server
[distro-setup] / btrbk-run
index 759b3a4782ae32407c86e5a5e5ba745a589d10f4..e812d5bd6388c4a240730d1cd905cf5be6638676 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -31,12 +31,14 @@ script_dir=$(dirname $(readlink -f "$BASH_SOURCE"))
 conf_only=false
 dry_run=false # mostly for testing
 resume_arg=
+do_i=true
 
-temp=$(getopt -l help hcnprt: "$@") || usage 1
+temp=$(getopt -l help hcinprt: "$@") || usage 1
 eval set -- "$temp"
 while true; do
     case $1 in
         -c) conf_only=true; shift ;;
+        -i) do_i=false; shift ;;
         -n) dry_run=true; dry_run_arg=-n; shift ;;
         -p) progress_arg="--progress"; shift ;;
         # btrbk arg: Resume only. Skips snapshot creation.
@@ -147,14 +149,17 @@ fi
 
 # for i, we just do a 1 way sync from master to backup,
 # and manually manage any changes to that.
-do_i=false
+i_possible=false
 for tg in ${targets[@]}; do
     # for an initial run, btrbk requires the dir to exist
     ssh root@$tg mkdir -p /mnt/root/btrbk
     if [[ $tg == frodo && $HOSTNAME == treetowl ]]; then
-        do_i=true
+        i_possible=true
     fi
 done
+if ! $i_possible; then
+    do_i=false
+fi
 
 
 vol=/mnt/root