own mailserver, lots of improvements
[distro-setup] / btrbk-run
index e812d5bd6388c4a240730d1cd905cf5be6638676..97b83e026f55379fddfa3c08de2b98bc4952dce1 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -25,8 +25,11 @@ usage() {
 
 script_dir=$(dirname $(readlink -f "$BASH_SOURCE"))
 
-# todo: finish figuring out fai / distro-setup
-# initial fstab / subvol setup.
+# note q is owned by root:1000
+# note p/m is owned 1000:1000 and chmod 700
+mountpoints=(/a)
+private_mountpoints=(/q /m)
+rsync_mountpoint=/q
 
 conf_only=false
 dry_run=false # mostly for testing
@@ -114,13 +117,11 @@ target_preserve_min 4h
 # btrbk -l debug -v dryrun
 EOF
 
-# note q is owned by root:1000
-# note p is owned 1000:1000 and chmod 700
-mountpoints=(/a)
-qmnt=/q
-if awk '{print $2}' /etc/fstab | grep -xF $qmnt &>/dev/null; then
-    mountpoints+=($qmnt)
-fi
+for mp in ${private_mountpoints[@]}; do # private mountpoints
+    if awk '{print $2}' /etc/fstab | grep -xF $mp &>/dev/null; then
+        mountpoints+=($mp)
+    fi
+done
 
 # if our mountpoints are from stale snapshots,
 # it doesn't make sense to do a backup.
@@ -204,8 +205,8 @@ else
     m btrbk $progress_arg $resume_arg run
 fi
 
-# if we have /p, rsync to targets without /p
-if mountpoint /p >/dev/null; then
+# if we have it, sync to systems which don't
+if mountpoint $rsync_mountpoint >/dev/null; then
     for tg in ${targets[@]}; do
         case $tg in
             tp|li|lk)