From: Ian Kelling Date: Fri, 13 Nov 2020 04:00:33 +0000 (-0500) Subject: various fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=1b3ca63de804a5557c43d9ad0e77520c129dcecd;p=distro-setup various fixes --- diff --git a/btrbk-run b/btrbk-run index c2b9e80..499ec88 100644 --- a/btrbk-run +++ b/btrbk-run @@ -76,9 +76,10 @@ if [[ -s $default_args_file ]]; then sleep 5 fi +early=false # quit early, just btrbk, no extra remounting etc. cron=false orig_args=("$@") -temp=$(getopt -l cron,pull-reexec,help cil:m:npqs:t:vh "$@") || usage 1 +temp=$(getopt -l cron,pull-reexec,help ceil:m:npqs:t:vh "$@") || usage 1 eval set -- "$temp" while true; do case $1 in @@ -89,6 +90,7 @@ while true; do ;; # only creates the config file, does not run btrbk -c) conf_only=true; shift ;; + -e) early=true; shift ;; -i) incremental_strict=true; shift ;; # bytes per second, suffix k m g -l) rate_limit=$2; shift 2 ;; @@ -130,6 +132,8 @@ if (( $# > 1 )); then fi if [[ -v targets && $source ]]; then + # note, this doesnt need to be the case, but + # we would need to think about it. die "error: -t and -s are mutually exclusive" fi @@ -147,11 +151,15 @@ fi # TODO: i wonder if there should be an option to send to the default # targets, plus any given on the command line. + +amy=false # set default targets if [[ ! -v targets && ! $source ]]; then if [[ $HOSTNAME != "$MAIL_HOST" ]] && $cron ; then echo "MAIL_HOST=$MAIL_HOST, nothing to do" mexit 0 + else + amy=true fi at_work=false @@ -397,7 +405,8 @@ volume ssh://$bbksource$vol subvolume $sub target send-receive $vol/btrbk EOF - else + fi + if (( ${#target[@]} )); then cat >>/etc/btrbk.conf <>/etc/btrbk.conf <<'EOF' +# volume ssh://amy/mnt/root +# subvolume root_ubuntubionic +# target send-receive /mnt/root/btrbk +# EOF +# fi # todo: umount first to ensure we don't have any errors # todo: do some kill fuser stuff to make umount more reliable @@ -442,6 +460,7 @@ fi # but it doesn't show when a send has a parent and when it doesn't. m btrbk $verbose_arg $progress_arg $cmd_arg +# todo: tp not valid anymore. # if we have it, sync to systems which don't if mountpoint $rsync_mountpoint >/dev/null; then for tg in ${targets[@]}; do diff --git a/conflink b/conflink index b70e26f..60d0372 100755 --- a/conflink +++ b/conflink @@ -128,7 +128,6 @@ common-file-setup() { } -install-my-scripts user=$(id -un) all_dirs=({/a/bin/ds,/p/c}{,/machine_specific/$HOSTNAME}) # note, we assume a group of hosts does not have the @@ -140,6 +139,7 @@ done c_dirs=(/a/c{,/machine_specific/$HOSTNAME}) case $user in iank) + /a/bin/ds/install-my-scripts files=(/p/c/machine_specific/*/filesystem/etc/ssh/*_key /p/c/filesystem/etc/openvpn/client/*.key /p/c/filesystem/etc/openvpn/easy-rsa/keys/*.key diff --git a/mail-setup b/mail-setup index de8638f..3bfc8b2 100755 --- a/mail-setup +++ b/mail-setup @@ -2226,8 +2226,11 @@ PATH=/usr/bin:/bin:/usr/local/bin MAILTO=alerts@iankelling.org */5 * * * * $u send-test-forward |& log-once send-test-forward */10 * * * * root chmod -R g+rw /m/md/bounces |& log-once -1 bounces-chmod -5-59/5 * * * * root mailtest-check |& log-once -1 mailtest-check -0 * * * * root mailtest-check slow |& log-once -1 mailtest-slow +# im seeing some intermittent failures on the slow check, do it all the time +# for now. It looks like a dns failure. +#5-59/5 * * * * root mailtest-check |& log-once -1 mailtest-check +#0 * * * * root mailtest-check slow |& log-once -1 mailtest-slow +*/5 * * * * root mailtest-check slow |& log-once -1 mailtest-check EOF m sudo rsync -ahhi --chown=root:root --chmod=0755 \ /b/ds/mailtest-check /b/ds/check-remote-mailqs /usr/local/bin/ diff --git a/mailtest-check b/mailtest-check index 9e35a0a..e8f146d 100755 --- a/mailtest-check +++ b/mailtest-check @@ -110,12 +110,12 @@ for folder in ${folders[@]}; do fi done if (( ${#results[@]} || ${#missing[@]} )); then - printf "$HOSTNAME spamtest %s %s" "$folder" "$from" + printf "$HOSTNAME spamtest %s %s/%s\n" "$folder" "$latest" if (( ${#results[@]} )); then - printf " unexpected %s" "${!results[*]}" + printf "unexpected %s" "${!results[*]} " fi if (( ${#missing[@]} )); then - printf " missing %s" "${missing[*]}" + printf "missing %s" "${missing[*]}" fi echo fi