#
#####################################################################
NAME="$(basename "${0}")"
-[ -e "/run/$NAME.no" ] && exit
+# NB 13.07.25 Done in crontab [ -e "/run/$NAME.no" ] && exit
LOCK="/run/nb/$NAME.lock"
[ -z "$UID" ] && UID="$(id -u)"
#LANG=C
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+NB_NOCRON=/run/nb-update.no
#####################################################################
# m h dom mon dow user command
#
@reboot root . /etc/profile && sleep 30 && nb-update >/var/log/nb-update.log 2>&1 | true
-*/30 09-23 * * * root . /etc/profile && nb-update >/var/log/nb-update.log 2>&1 | true
-13 00 * * * root . /etc/profile && nb-update -cleanup >/var/log/nb-update.log 2>&1 | true
-13 01-08 * * * root . /etc/profile && nb-update >/var/log/nb-update.log 2>&1 | true
-25 5 * * * root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.daily" ] && cd / && run-parts --report $NB_ROOT/etc/cron.daily
-47 4 * * 7 root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.weekly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.weekly
-52 3 1 * * root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.monthly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.monthly
-52 1 1 * * root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.yearly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.yearly
+*/30 09-23 * * * root [ ! -e "$NB_NOCRON" ] && . /etc/profile && nb-update > /var/log/nb-update.log 2>&1 | true
+13 00 * * * root [ ! -e "$NB_NOCRON" ] && . /etc/profile && nb-update -cleanup > /var/log/nb-update.log 2>&1 | true
+13 01-08 * * * root [ ! -e "$NB_NOCRON" ] && . /etc/profile && nb-update > /var/log/nb-update.log 2>&1 | true
+
+25 5 * * * root [ ! -e "$NB_NOCRON" ] && which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.daily" ] && cd / && run-parts --report $NB_ROOT/etc/cron.daily
+47 4 * * 7 root [ ! -e "$NB_NOCRON" ] && which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.weekly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.weekly
+52 3 1 * * root [ ! -e "$NB_NOCRON" ] && which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.monthly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.monthly
+52 1 1 * * root [ ! -e "$NB_NOCRON" ] && which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT" -a -d "$NB_ROOT/etc/cron.yearly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.yearly