Crond:

Marco Pracucci development at pracucci.com
Wed Sep 19 10:56:43 UTC 2007


Hi,

I have seen that crond check if there are jobs to run the first second
of each minute. This behavior lead to the following situation: if I have
a job that should be run every minute, when I start crond it just not
execute this job, but it waits until the next minute.

[...]
    /*
     * main loop - synchronize to 1 second after the minute, minimum sleep
     *             of 1 second.
     */
[...]
        for (;;) {
            sleep((sleep_time + 1) - (short) (time(NULL) % sleep_time));
[...]


For example: my system start crond at boot and I have a job that should
be run every minute. If crond is started at 12:50:10, crond execute this
job at 12:51:01, while I would also run it at 12:50:*.

Is there any wait to change this behavior?
Why don't crond test jobs as soon as it's started and then it test jobs
every first second of each minute?

Thanks,
Marco Pracucci




More information about the busybox mailing list