You are not logged in.

#1 2014-03-29 17:15:34

snakeroot
Member
Registered: 2012-10-06
Posts: 164

systemd 212 anacron functionality

I'm very excited about this improvement and looking forward to implementing it on a couple of my services.

As I understand it, this means if my laptop is off, hibernating or suspended while a service's timer is scheduled to go off, it will be picked up the next time my laptop goes live.

So first, is this understanding correct?

Second, as I understand it, to implement this functionality what I need to do is have a timer with an "OnCalendar" timer and "Persistent" set to yes. For example,  for a service to run every week, I'd have the following in my .timer file:

[Timer]
OnCalendar=weekly
Persistent=yes

The intervals either need to be calendar dates or one of the special hourly/daily/weekly calendar events (man systemd.time).

Is this correct?

Lastly, is there any functionality so that if a service fails the timer will retry before the normal period of time?

For example, two of the services I'd like to convert (pkgstat and a script I have for updating mirrorlists) both require internet access (which I may or may not have when the timer triggers). Ideally, I'd like the services to retry before the next weekly timer rolls around. If this is built in to systemd, that would be great: otherwise I'm certain I can cobble together a script-based solution as needed.

Thanks,

EDIT: To correct "OnCalendar" to use calendar event per systemd.time

Last edited by snakeroot (2014-03-29 18:26:59)

Offline

Board footer

Powered by FluxBB