Difference between revisions of "Talk:Systemd/Timers"

From ArchWiki
Jump to: navigation, search
(Counterproductive Suggestions: new section)
Line 34: Line 34:
  
 
Do you think this option is needed anymore with the coming of the "Persistent" option in systemd 212? - [[User:Genghizkhan91|Genghizkhan91]] ([[User talk:Genghizkhan91|talk]]) 08:44, 1 April 2014 (UTC)
 
Do you think this option is needed anymore with the coming of the "Persistent" option in systemd 212? - [[User:Genghizkhan91|Genghizkhan91]] ([[User talk:Genghizkhan91|talk]]) 08:44, 1 April 2014 (UTC)
 +
 +
== Counterproductive Suggestions ==
 +
 +
The suggestions on this page are counterproductive. By merging all units under a single target, you're intentionally creating a stampede when the timer goes off. One of the great features of timer units is that a combination of OnCalendar and AccuracySec can trivially mitigate the overlap that's associated with classic cron while still maintaining regularity. This is distinctly better than classic cron which would force a human to schedule the task jitter manually.
 +
 +
In addition, it isn't reasonable to queue these on basic.target as one wants a fully operational system before cron will run. Much like how cron daemons were treated like any other daemon and brought up in runlevel 3 under sysvinit, it makes much more sense to order timers on multi-user.target. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 23:38, 4 May 2014 (UTC)

Revision as of 23:38, 4 May 2014

Monthly events

Is there any specific reason why "monthly" timing isn't presented? A limitation in systemd workings or whatever? I was more feeling like setting the "pkgstats.service" to run once a month, this is how I realized I hadn't created such folder by following the article.

Only modifications -- apart from substituting "weekly" by "monthly" everywhere relevant -- seem to be in the [Timer] section:

/etc/systemd/system/timer-monthly.timer
[Unit]
Description=Monthly Timer

[Timer]
OnBootSec=20min
OnUnitActiveSec=1month
Unit=timer-monthly.target

[Install]
WantedBy=basic.target
/etc/systemd/system/timer-monthly.target
[Unit]
Description=Monthly Timer Target
StopWhenUnneeded=yes

If that seems ok to you I'll add it and update mkdir/systemctl instructions accordingly.

Neitsab (talk) 18:47, 12 January 2014 (UTC)

I'd certainly use the OnCalendar directive for monthly events - mainly because of this note (from Systemd/cron_functionality#Daily_events):
"Systemd does not currently reschedule timers based on the last time they were run if the system is rebooted in between, i.e. it does not implement an anacron replacement."
That might be usable for servers, but certainly not for for laptops/desktops. I'm using OnCalendar even for weekly events, perhaps that should be changed/suggested in the article.
-- Lahwaacz (talk) 17:15, 31 January 2014 (UTC)

Regarding OnBootSec

Do you think this option is needed anymore with the coming of the "Persistent" option in systemd 212? - Genghizkhan91 (talk) 08:44, 1 April 2014 (UTC)

Counterproductive Suggestions

The suggestions on this page are counterproductive. By merging all units under a single target, you're intentionally creating a stampede when the timer goes off. One of the great features of timer units is that a combination of OnCalendar and AccuracySec can trivially mitigate the overlap that's associated with classic cron while still maintaining regularity. This is distinctly better than classic cron which would force a human to schedule the task jitter manually.

In addition, it isn't reasonable to queue these on basic.target as one wants a fully operational system before cron will run. Much like how cron daemons were treated like any other daemon and brought up in runlevel 3 under sysvinit, it makes much more sense to order timers on multi-user.target. Falconindy (talk) 23:38, 4 May 2014 (UTC)