]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add new functionality and syntax to cron(1) to allow to run jobs at a
authorglebius <glebius@FreeBSD.org>
Thu, 7 Jun 2018 22:38:40 +0000 (22:38 +0000)
committerglebius <glebius@FreeBSD.org>
Thu, 7 Jun 2018 22:38:40 +0000 (22:38 +0000)
commitbb27a539de5520ee18ff80dc6d14fd591b3d02f2
tree9f8b684c9cdceaaab593b8d4d4230e230ca695cc
parent1dfe30dc125504922d6f4090340c84ce3ea5e844
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.

Sponsored by: Netflix
usr.sbin/cron/cron/cron.c
usr.sbin/cron/cron/cron.h
usr.sbin/cron/cron/do_command.c
usr.sbin/cron/crontab/crontab.5
usr.sbin/cron/lib/entry.c