remove kinsis / unused input settings
[distro-setup] / btrbk-run
index e5d0b5e4d54a2124c6271a1cdc56b4019133cb09..5ff83260022c20d1eeec2217ae8392b61653b69d 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -13,6 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
+# todo: remove old leaf subvols, like keep up to 1 month or something.
+
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
@@ -78,7 +81,7 @@ echo -e "$0: options: conf_only=$conf_only\ndry_run=$dry_run\nresume_arg=$resume
 # set default targets
 if [[ ! -v targets ]]; then
     case $HOSTNAME in
-        x2)
+        x2|fz)
             if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
                 targets=($HOME_DOMAIN)
             fi
@@ -113,14 +116,23 @@ if (( ${#mountpoints[@]} )); then
         fi
     done
 else # set default mountpoints
-    if [[ $HOSTNAME == frodo ]]; then
-        prospective_mps=(/i)
-    else
-        prospective_mps=(/a /q)
-        if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
-            prospective_mps+=(/o)
-        fi
-    fi
+    case $HOSTNAME in
+        frodo)
+            prospective_mps=(/i)
+            ;;
+        *)
+            prospective_mps=(/a /q)
+            if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
+                prospective_mps+=(/o)
+            fi
+            ;;
+    esac
+    case ${targets[0]} in
+        kw|kww)
+            prospective_mps=(/a)
+            ;;
+    esac
+
     for mp in ${prospective_mps[@]}; do # default mountpoints to sync
         if [[ -e /nocow/btrfs-stale/$mp ]]; then
             echo "$0: warning: $mp stale, not adding to default mountpoints"
@@ -165,7 +177,7 @@ if ! which btrbk &>/dev/null; then
 fi
 
 cat >/etc/btrbk.conf <<EOF
-ssh_identity /root/.ssh/id_rsa
+ssh_identity /root/.ssh/home
 # Just a guess that local7 is a good facility to pick.
 # It's a bit odd that the transaction log has to be logged to
 # a file or syslog, while other output is sent to std out.