aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-21 21:40:16 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-21 21:42:22 +0200
commit58a28dc1157107c74bc03b7558f57c5732299960 (patch)
tree48e89613e87a88dd24ecae6181a4e3872422a871
parent87e0ded55b547f35115dc83ac76db2729c043e85 (diff)
downloadlbsd-58a28dc1157107c74bc03b7558f57c5732299960.tar.gz
Move daily, weekly, monthly jobs to anacrontab
-rw-r--r--etc/rc.conf1
-rw-r--r--usr/pkg/etc/anacrontab15
-rw-r--r--var/cron/tabs/root9
3 files changed, 20 insertions, 5 deletions
diff --git a/etc/rc.conf b/etc/rc.conf
index 3cfc03e..81b929c 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -28,3 +28,4 @@ apmd=YES
powerd=YES
estd=YES
squid=NO
+anacron=YES
diff --git a/usr/pkg/etc/anacrontab b/usr/pkg/etc/anacrontab
new file mode 100644
index 0000000..ac928ef
--- /dev/null
+++ b/usr/pkg/etc/anacrontab
@@ -0,0 +1,15 @@
+# $NetBSD: anacrontab.NetBSD,v 1.2 2007/07/02 08:40:39 joerg Exp $
+#
+# anacrontab - Configuration file for NetBSD.
+#
+# See anacrontab(5) and anacron(8) for more information.
+#
+
+SHELL=/bin/sh
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+HOME=/var/log
+
+#days delay id command
+1 5 daily /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t
+7 15 weekly /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t
+30 30 monthly /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | sendmail -t
diff --git a/var/cron/tabs/root b/var/cron/tabs/root
index 3c1024a..4f287f4 100644
--- a/var/cron/tabs/root
+++ b/var/cron/tabs/root
@@ -1,5 +1,5 @@
# DO NOT EDIT THIS FILE - edit the master and reinstall.
-# (/tmp/crontab.OldKDfr000 installed on Wed Jul 21 21:39:15 2021)
+# (/tmp/crontab.KdON01tLfK installed on Wed Jul 21 21:42:09 2021)
# (Cron version V5.0 -- $NetBSD: crontab.c,v 1.15 2018/03/06 21:21:27 htodd Exp $)
#
SHELL=/bin/sh
@@ -11,9 +11,8 @@ CRON_WITHIN=7200
#
*/10 * * * * /usr/libexec/atrun
#
+# run anacron jobs every hour
+0 * * * * /usr/pkg/sbin/anacron
+#
# rotate log files every hour, if necessary
0 * * * * /usr/bin/newsyslog
-# do daily/weekly/monthly maintenance
-15 4 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t
-30 5 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t
-30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | sendmail -t