X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;h=f3589700b35729fa4cbb691e265a83e64c11658a;hb=7cc6197f74e97cb522894046718712cd03d3d385;hp=187a29a86bcab7a1e1218e94adfea65c664eeddc;hpb=82c5e0663bcd7181f8943a0cac03ead8dbd3ff99;p=distro-setup diff --git a/btrbk-run b/btrbk-run index 187a29a..f358970 100644 --- a/btrbk-run +++ b/btrbk-run @@ -126,7 +126,7 @@ fi # set default targets if [[ ! -v targets && ! $source ]]; then if [[ $HOSTNAME != "$MAIL_HOST" ]] && $cron ; then - echo "We are not MAIL_HOST, nothing to do" + echo "MAIL_HOST=$MAIL_HOST, nothing to do" exit 0 fi case $HOSTNAME in @@ -255,8 +255,16 @@ else sshable=() sshfail=() + min_idle_ms=$((1000 * 60 * 15)) for h in ${targets[@]}; do if zone=$(ssh root@$h "mkdir -p /mnt/root/btrbk && date +%z"); then + if $cron && DISPLAY=:0 xprintidle; then + # This is a separate ssh because xprintidle can fail and thats ok. + # Ignore this host. i sometimes use a non-main machine for testing or web browsing, knowing that + # everything will be wiped by the next backup, but I dont want it to happen as Im using + # it from cronjob. + continue + fi sshable+=($h) if [[ $zone != $local_zone ]]; then die "error: dont confuse yourself with multiple time zones. $h has different timezone than localhost"