X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;h=5ff83260022c20d1eeec2217ae8392b61653b69d;hb=65351382939fa95fb1e05d7d83eb58d27c3c6133;hp=e5d0b5e4d54a2124c6271a1cdc56b4019133cb09;hpb=3a5055dce8796a1946d9f75d8c74605eb73d19df;p=distro-setup diff --git a/btrbk-run b/btrbk-run index e5d0b5e..5ff8326 100755 --- 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 <