[timer] solution (élégante ?) au problème des timers

Questions et astuces concernant l'installation et la configuration d'archlinux
Moviuro
Elfe
Messages : 765
Inscription : dim. 17 juin 2012, 22:49

[timer] solution (élégante ?) au problème des timers

Message par Moviuro »

Plop,

en réaction à l'article cron systemd du wiki ("controverse"), j'ai la solution suivante :

Code : Tout sélectionner

% cat timer-daily@.timer
[Unit]
Description=Daily Timer for the %i service

[Timer]
OnCalendar=daily
Persistent=true
Unit=%i.service

[Install]
WantedBy=multi-user.target

Code : Tout sélectionner

# systemctl enable timer-daily@{monservice}.timer
TADA ! (et bien sûr, on fait les mêmes avec hourly, weekly et plus si affinité).
Je mets ça dans le wiki ? (seul problème, ça marche pas avec une target)
psycho : Latitude E6430 ; BTRFS over LUKS, UEFI & secureboot
schizo : Acer 8942G ; KDE 4, BTRFS over LUKS ; W7 (prend la poussière)
toxo : i5-6600K, bspwm, VM W10 en PCI-passthrough
deadman : Lenovo Thinkcenter, OpenBSD 6.0-stable
popho.be : Kimsufi KS-3, FreeBSD 11.0
Loi de Murphy : Le jour où tu as besoin d'une backup, tu te dis que tu aurais dû en mettre en place
Venez sur IRC en plus du forum !
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17615
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [timer] solution (élégante ?) au problème des timers

Message par benjarobin »

Pourquoi avoir enlevé le lien vers la discussion : https://wiki.archlinux.org/index.php/Ta ... ctionality
Surtout que tu as eu une réponse à ta question
That is definitely nicer than the old unified timer example! However it still has the problem of all services using this timer starting simultaneously, which I think was the main complaint originally. Though based on the discussion about AccuracySec being random per-host (and thus useless for timer jitter), we still have no better solution than just per-service timers with manually staggered triggers. Silverhammermba (talk) 22:47, 1 September 2014 (UTC)
Zsh | KDE | PC fixe : AMD Ryzen 9900X, Radeon RX 7700 XT
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
Répondre