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:
=Using Cron=
=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; /run/current-system/sw/bin/r2e run"
       "*/10 * * * *  johndoe  . /etc/profile; ${pkgs.rss2email}/bin/r2e run"
</syntaxHighlight>
</syntaxHighlight>


Line 31: Line 38:


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
       "0 * * * *      hyper   out=$( /run/current-system/sw/bin/pass git pull 2>&1 ) || echo $out"
       "0 * * * *      johndoe   out=$( ${pkgs.pass}/bin/pass git pull 2>&1 ) || echo $out"
</syntaxHighlight>
</syntaxHighlight>