]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r334817, r334910
authorkevans <kevans@FreeBSD.org>
Mon, 22 Apr 2019 03:04:39 +0000 (03:04 +0000)
committerkevans <kevans@FreeBSD.org>
Mon, 22 Apr 2019 03:04:39 +0000 (03:04 +0000)
commit513028fe04867513a9e06e74d0e13a03bca61fa6
treef99a397ab4d8d22692a1923eebf31fd12c8ade1a
parentbb1dea09f6f0f4201fe952686bf4b1619ab6c5ce
MFC r334817, r334910

r334817:
Add new functionality and syntax to cron(1) to allow to run jobs at a
given interval, which is counted in seconds since exit of the previous
invocation of the job. Example user crontab entry:

@25 sleep 10

The example will launch 'sleep 10' every 35 seconds. This is a rather
useless example above, but clearly explains the functionality.

The practical goal here is to avoid overlap of previous job invocation
to a new one, or to avoid too short interval(s) for jobs that last long
and doesn't have any point of immediate launch soon after previous run.

Another useful effect of interval jobs can be noticed when a cluster of
machines periodically communicates with a single node. Running the task
time based creates too much load on the node. Running interval based
spreads invocations across machines in cluster. Note that -j/-J won't
help in this case.

r334910:
Remove old, dead compat code.

We no longer need to od these things conditionally, and the fallbacks
are to 4.2BSD era defaults, which nobody uses anymore. Vixie cron has
diverged from upstream anyway in our tree, and it's not clear there's
actually a viable upstream anymore. Plus, we don't follow the
vendor-supplied code pattern here.

I'm doing this to reduce false positives from grep.
usr.sbin/cron/cron/cron.c
usr.sbin/cron/cron/cron.h
usr.sbin/cron/cron/do_command.c
usr.sbin/cron/cron/pathnames.h
usr.sbin/cron/crontab/crontab.5
usr.sbin/cron/lib/entry.c