if $restore; then
set -x
- # for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
- # ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running
- # rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir || ret=$?
- # done
+ for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
+ ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running
+ rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir || ret=$?
+ done
rsync -ravi /p/bkbackup/rc/ root@$host:/m/rc
exit 0
fi
+ret=0
if [[ $HOSTNAME == $MAIL_HOST ]]; then
mkdir -p /p/bkbackup
for ncdir in /var/www/ncexpertpath /var/www/ncninja; do
ncbase=${ncdir##*/}
mkdir -p /p/bkbackup/$ncbase
ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on
- rsync -ra root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
+ rsync -rai --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --off
- if (( $ret )) then
- echo "$0: failed rsync $ncdir"
- exit $ret
+ if (( $ret )); then
+ echo "$0: error: failed rsync $ncdir"
+ ret=1
fi
done
- rsync -ra root@$host:/m/rc /p/bkbackup
+ rsync -rai --delete root@$host:/m/rc /p/bkbackup
fi
+exit $ret
type master;
file "/var/lib/bind/db.9.c.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa";
};
+
+zone "d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa" {
+type master;
+file "/var/lib/bind/db.d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa";
+};
# is being called when it shouldnt when rereunning we are probably
# updating systemd config file that doesnt need to be or something.
+# todo: mailtest-check failure on remote hosts is not going to alert me.
+# sort that out.
+
+# todo: test out icedove
+
+# todo: test out nextcloud mail plugin
+
# background: I want to run exim in a network namespace so it can send
# and receive through a vpn. This is needed so it can do ipv6, because
# outside the namespace if we dont have ipv6, to send ipv6 through the
;;&
$MAIL_HOST)
test_from=ian@iankelling.org
- test_to="testignore@expertpathologyreview.com, testignore@je.bk.nz"
+ test_to="testignore@expertpathologyreview.com, testignore@je.b8.nz"
cat >>/etc/cron.d/mailtest <<EOF
2 * * * * $u check-remote-mailqs |& log-once check-remote-mailqs
;;&
bk)
test_from=testignore@expertpathologyreview.com
- test_to="testignore@iankelling.org, testignore@je.bk.nz"
+ test_to="testignore@iankelling.org, testignore@je.b8.nz"
;;&
je)
test_from=testignore@je.b8.nz
fi
-folder=/m/md/l/testignore/new
-if [[ $HOSTNAME == bk ]]; then
- folder=/m/md/expertpathologyreview.com/testignore/cur
-fi
-find $folder -type f -mmin +300 -delete
+folder=/m/md/l/testignore
+case $HOSTNAME in
+ bk)
+ folder=/m/md/expertpathologyreview.com/testignore
+ ;;
+ je)
+ folder=/m/md/je.b8.nz/testignore
+ ;;
+esac
+find $folder/new $folder/cur -type f -mmin +300 -delete
cd $folder
last_sec=0
-for file in *; do
+# webmail sends them to cur it seems
+for file in new/* cur/*; do
if [[ $file -nt $latest ]]; then
latest=$file
fi
done
if [[ $latest ]]; then
- last_sec=$(awk '/^Subject: / {print $3}' $latest)
+ last_sec=$(awk '/^Subject: / {print $4}' $latest)
fi
now=$(date +%s)