[systemd-devel] Stop systemd timer upon success script and restart the next day

Mantas Mikulėnas grawity at gmail.com
Thu May 16 05:40:03 UTC 2019

On Wed, May 15, 2019 at 11:21 PM Jeffrey Walton <noloader at gmail.com> wrote:

> I have a systemd timer that starts a service, and the service executes
> a script that downloads data files once a day. Once the data files are
> retrieved I don't need the timer for the remainder of the day.
> However, I need the time again the next day.
> Here are the two docs I found on scheduling a timer, but I was not
> able to parse out the info I needed.
> https://www.freedesktop.org/software/systemd/man/systemd.timer.html
> and https://www.freedesktop.org/software/systemd/man/systemd.time.html
> .
> How do I specify a timer that starts 6:00 AM every morning, fires once
> an hour, and then stops for the day upon success of the download?

I think you only do "every hour 6:00 to XX:00" through systemd.timer and
the rest through script logic – simply make the script exit if it finds
today's data already having been downloaded.

Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190516/3b290c0a/attachment.html>

More information about the systemd-devel mailing list