LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Systemd v219 timer not calculating correct next date on RHEL 7.2? (https://www.linuxquestions.org/questions/linux-software-2/systemd-v219-timer-not-calculating-correct-next-date-on-rhel-7-2-a-4175606889/)

sjnorman 05-29-2017 07:41 AM

Systemd v219 timer not calculating correct next date on RHEL 7.2?
 
Hi,
I'm trying to create a systemd timer to restart a corresponding service based on a specific calendar format.

When I enable and start the timer, the first trigger fires correctly and the service is re-started, but the next timer date isn't updated and never triggers again.

Here's my timer definition:
note: the date below is currently arbitrary -- once I figure out how this works the actual values wanted will be used

Quote:

[Unit]
Description=Timer for mytestprogram

[Timer]
OnCalendar=Mon,Wed,Fri *-*-* 6:50:00

[Install]
WantedBy=multi-user.target
Once the first timer fires, the output of systemctl list-timers is as follows:

Code:

NEXT                        LEFT      LAST                        PASSED              UNIT                      ACTIVATES
Mon 2017-05-29 06:50:00 CDT  35min ago Mon 2017-05-29 06:50:00 CDT  35min ago          mytestprogram.timer      mytestprogram.service

As you can see, the timer executed on Monday, May 29th and the next trigger date is not updated -- I was expecting the NEXT trigger to be updated to Wed 2017-05-31 06:50:00 CDT.

Is there something wrong with my OnCalendar date?

The way I understand it, the timer should fire on Monday, Wednesday and Friday every week at 6:50AM.

I'm running systemd 219 on RHEL 7.2.

Thanks!

norobro 05-29-2017 10:25 AM

Quote:

Originally Posted by sjnorman (Post 5716498)
Is there something wrong with my OnCalendar date?

Looked okay to me so I tried it out by changing the time:
Code:

[Timer]
OnCalendar=Mon,Wed,Fri *-*-* 10:15:00

Code:

Wed 2017-05-31 10:15:00 CDT  1 day 23h left Mon 2017-05-29 10:15:01 CDT  1s ago      mytestprogram.timer          mytestprogram.service
No idea what the problem is though.


All times are GMT -5. The time now is 12:49 PM.