From 58a28dc1157107c74bc03b7558f57c5732299960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 21 Jul 2021 21:40:16 +0200 Subject: Move daily, weekly, monthly jobs to anacrontab --- etc/rc.conf | 1 + usr/pkg/etc/anacrontab | 15 +++++++++++++++ var/cron/tabs/root | 9 ++++----- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 usr/pkg/etc/anacrontab 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 -- cgit v1.2.3