I would have my timer be duration-based instead of calandar based
(assuming that fits your need) You could use one of the following _OnActiveSec_=48h (two days after the timer last triggered _OnUnitActiveSec_=48h (two days afte the unit was last started) Or slightly different _OnUnitInactiveSec_=24h (one day after the service FINISHED) In all those cases, since this is interval based, you would need a way to "prime the pump" I usually do this with _OnStartupSec_=15m (1/4h after the machine was started) or simply by enabling the service itself so it's part of the boot sequence (this will work with OnUnitActive and OnUnitInactive, but not with OnActive) On 05/11/2018 09:36, Andy Pieters
wrote:
Dear Systemd list I have got a job that I want to execute every other day. The job is rather lengthy and takes more than 24 hours to complete but less than 48. So here are my criteria: Start today Start the day after tomorrow (t+2d)*1 Start the (t+2d)*2 Start 2 days after that (t+2d)*n My timer unit: [Timer] _OnCalendar_=*-*-01,03,05,07,09,11,13,15,17,19,21,23,25,27,29,31 03:30:00 The problem with that is when I simulate the execution dates, specifically at newyear: Tue 2018-12-25 03:30:00 CET Thu 2018-12-27 03:30:00 CET Sat 2018-12-29 03:30:00 CET Mon 2018-12-31 03:30:00 CET Tue 2019-01-01 03:30:00 CET Thu 2019-01-03 03:30:00 CET Sat 2019-01-05 03:30:00 CET Mon 2019-01-07 03:30:00 CET Wed 2019-01-09 03:30:00 CET We can see that the timer would be triggered two days in a row. What can we do about this, please? Is there a better way to define a timer to run every other day? Can we perhaps add an exception for a specific date? Thank you kindly Keep up the good work! Andy _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel |
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel