]> git.nbdom.net Git - nb.git/commitdiff
etc/cron/nb
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 13 Jul 2025 07:10:40 +0000 (09:10 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 13 Jul 2025 07:10:40 +0000 (09:10 +0200)
bin/nb-update
etc/cron/nb

index 9b91ef9bb7651fda3d093b3576e747d7d19e6e27..06549ed4003f4ae611c8313907093e4710f65009 100755 (executable)
@@ -6,7 +6,7 @@
 #
 #####################################################################
 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)"
 
index 5917d0f02562718d944b8478ab5819708914d388..402758a8c4556b2f8d598907a2088e57b6bfdd65 100644 (file)
@@ -4,16 +4,18 @@
 #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