Cron: Difference between revisions

imported>Cyounkins
m link to systemd/timers
DHCP (talk | contribs)
m fix indentation
 
Line 12: Line 12:


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
  # Enable cron service
# Enable cron service
  services.cron = {
services.cron = {
    enable = true;
  enable = true;
    systemCronJobs = [
  systemCronJobs = [
      "*/5 * * * *      root    date >> /tmp/cron.log"
    "*/5 * * * *      root    date >> /tmp/cron.log"
    ];
  ];
  };
};
</syntaxHighlight>
</syntaxHighlight>


Line 28: Line 28:


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
      "*/10 * * * *  johndoe  . /etc/profile; ${pkgs.rss2email}/bin/r2e run"
"*/10 * * * *  johndoe  . /etc/profile; ${pkgs.rss2email}/bin/r2e run"
</syntaxHighlight>
</syntaxHighlight>


Line 38: Line 38:


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