0

I have a timer that should run every 60 seconds like this:

[Unit]
Description=Trigger test timer

[Timer]
OnActiveSec=60

The timer triggers after waiting 60 seconds. But I want it to trigger immediately on start and then again at 60 second intervals. How do I specify that?

2 Answers 2

0

The following seems to work:

[Unit]
Description=Trigger test timer

[Timer]
OnActiveSec=0
OnCalendar=*:0/1

The OnActiveSec makes the timer run immediately and the OnCalendar makes it run every minute. The time between the first and second run is random though.

-1

On some systems I use:

[Timer]
OnCalendar=*:0/1

This will run something approximately once per minute

3
  • But I believe that will wait till the next full minute to run. Commented Jul 13, 2021 at 15:35
  • Are you running a *.service that takes longer than 60s to execute, and you want multiple instances of the service, each one starting 60s from the start of the previous one?
    – Stewart
    Commented Jul 13, 2021 at 15:37
  • No. The service only takes a split second to run. But it must ran at times 0, 60, 120, ... The first run is important. Commented Jul 14, 2021 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .