Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2008 20:02:05 +0200
From:      "Artem Naluzhnyy" <tut@nhamon.com.ua>
To:        freebsd-hackers@freebsd.org
Subject:   crontab(5) enhancements
Message-ID:  <65dfa4fc0811261002w61224c0ey9ed987f3f8122db0@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have two suggestion for newsyslog(8) and periodic(8) entries in
default /etc/crontab file:

* nice(1) newsyslog and periodic entries to shape CPU load spikes;
* lockf(1) them to prevent simultaneous execution.

So instead
  1 3 * * * root periodic daily
there may be
  1 3 * * * root lockf -t0 /var/run/periodic.daily.lock nice -20 periodic daily

In case of collision we'll receive following email:

Date: Wed, 26 Nov 2008 18:16:00 +0200 (EET)
From: root@tut.at.home (Cron Daemon)
To: root@tut.at.home
Subject: Cron <root@tut> lockf -t0 /var/run/periodic.daily.lock nice
-20 periodic daily

lockf: /var/run/periodic.daily.lock: already locked


The configuration has been working for years on my servers without any
visible drawbacks.

What do you think?

-- 
Artem Naluzhnyy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65dfa4fc0811261002w61224c0ey9ed987f3f8122db0>