Ways to help investigating behavior of periodic scripts

Polytropon freebsd at edvax.de
Tue Oct 31 00:06:40 UTC 2017

On Tue, 31 Oct 2017 08:07:31 +0900 (JST), Yasuhiro KIMURA wrote:
> As you know cron(8) executes daily periodic scripts at 03:01 of every
> day and 2 mails are sent to root reporting output of each script. On
> my home server (11.1-RELEASE amd64) these mails usually arrive before
> 03:10. But sometimes they arrive after 03:30 and in rare case after
> 04:00. The delay is not problem for me but I would like to know why it
> happens.

Several reasons are possible.

For example, all the find-related processes usually search
all mounted file systems. Let's say that you have an external
hard disk mounted when the 3 o'clock run starts, it will be
searched; if not, it won't. There are also options that affect
the runtime of certain system scripts. You can find a list in
/etc/defaults/periodic.conf which _might_ be overriden in
/etc/periodic.conf if present. See "man periodic.conf" for
additional information.

> So are there any ways to help investigating this delay?
> (Option to make periodic(8) write start and end time of each script to
> syslog, for example.)

You could add this manually to /usr/sbin/periodic; I'm not
aware of a built-in mechanism to log the starting / finishing
time of the many scripts that are run (depending on daily,
weekly or monthly call).

> BTW I'm not sure if this ML is best place to ask this question. So
> plese let me know if I should move to other ML.

This list is a good place to start. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list