systemd timer NEXT time is in the past

rcv asked:

I have a systemd timer that I would like to run every weekday morning at 5:30am. Here’s the .timer file:

Description=My Cool Timer

OnCalendar=Mon-Fri 05:30:00


I set up this timer last night, and it fired this morning right on schedule. However, checking on its status shows that it’s next scheduled firing (LEFT) is 8 hours ago:

[email protected]: sudo systemctl list-timers myCoolTimer.timer
NEXT                         LEFT     LAST                         PASSED             UNIT                         ACTIVATES
Thu 2016-09-01 05:30:00 PDT  8h ago   Thu 2016-09-01 05:30:00 PDT  8h ago             myCoolTimer.timer          myCoolTimer.service

I’m not sure if it matters, but the associated .service file is Type=forking.

How do I get my timer to actually repeat?

My answer:

I think you missed this bit of the documentation:

Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running.

The timer does nothing at the next scheduled time, because the service is already running.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.