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
;;
# 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 ;;
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
# 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
subvolume $sub
target send-receive $vol/btrbk
EOF
- else
+ fi
+ if (( ${#target[@]} )); then
cat >>/etc/btrbk.conf <<EOF
volume $vol
subvolume $sub
fi
done
+# if $amy; then
+# # to manually backup amy,
+# # bbk -e -s amy -m root_ubuntubionic
+# cat >>/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
# 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
}
-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
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
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/
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