X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;h=df17880ed025497749c535431a640797eabf0422;hb=0cc08a73110c15c4e7bbb8c8233a6c122c27490e;hp=602422987946e1c87b4dbf3e86094108056706c2;hpb=af37f71b1c4e1dfa9ebe9a270f4b839cd742cad5;p=distro-setup diff --git a/btrbk-run b/btrbk-run old mode 100755 new mode 100644 index 6024229..df17880 --- a/btrbk-run +++ b/btrbk-run @@ -24,13 +24,22 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat <<'EOF' btrbk-run [OPTIONS] -usually -t TARGET_HOST +usually -t TARGET_HOST or -s SOURCE_HOST + +Note, at source location, intentionally not executable, run and read +install-my-scripts. + EOF echo "top of script file:" sed -n '1,/^[# ]*end command line/{p;b};q' "$0" exit $1 } +# latest $MAIL_HOST +if [[ -e /b/bash_unpublished/source-semi-priv ]]; then + source /b/bash_unpublished/source-semi-priv +fi + script_dir=$(dirname $(readlink -f "$BASH_SOURCE")) # note q is owned by root:1000 @@ -143,11 +152,6 @@ case $HOSTNAME in 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 @@ -264,6 +268,7 @@ fi if $dry_run; then m btrbk -v -n $cmd_arg + exit 0 elif [[ $cmd_arg == archive ]]; then if [[ $source ]]; then m btrbk $verbose_arg $progress_arg $cmd_arg ssh://$source$vol $vol @@ -294,11 +299,11 @@ if mountpoint $rsync_mountpoint >/dev/null; then done fi -PATH=$script_dir:$PATH +/a/bin/distro-setup/install-my-scripts if [[ $source ]]; then m mount-latest-subvol else - m mount-latest-remote ${targets[@]} + m /a/exe/mount-latest-remote ${targets[@]} fi # todo: move variable data we don't care about backing up