Next: , Previous: Every second Sunday, Up: Extended Guile examples

3.2.3 Two hours every day

Surprisingly perhaps, the following will not have the desired effect.

     (job '(next-hour-from (next-day) '(1 2))

Rather than running the my-program program at one o'clock and two o'clock every day, it will only run it at one o'clock. This is because each time mcron has to compute the next time to run the command, it first obtains the next day, and then finds the earliest hour in that day to run at. Thus, after running the command at one o'clock, the program first skips forwards to the next midnight (missing the two o'clock appointment), and then finds the next one o'clock schedule.

The following simple command is the correct way to specify this behaviour.

     (job '(next-hour '(1 2)) "my-program")