Cron: Difference between revisions
imported>Sjau No edit summary |
imported>Cyounkins m link to systemd/timers |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
= | =Cron= | ||
==Deprecated== | |||
It is recommended to use [[Systemd/Timers|systemd-timers]]. A few of many reasons: | |||
* logs are logged to journalctl instead of relying on local mail | |||
* different timers are independent of each other and do not share an environment | |||
* better configurability like random offsets, run missed timers when machine was powered down and full systemd service option | |||
==General== | ==General== | ||
| Line 21: | Line 28: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
"*/10 * * * * johndoe . /etc/profile; | "*/10 * * * * johndoe . /etc/profile; ${pkgs.rss2email}/bin/r2e run" | ||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 31: | Line 38: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
"0 * * * * | "0 * * * * johndoe out=$( ${pkgs.pass}/bin/pass git pull 2>&1 ) || echo $out" | ||
</syntaxHighlight> | </syntaxHighlight> | ||