Not directly helping you with cron, but any reason why you are using cron instead of systemd timers? The functionality is the same, but output is logged to journald, status is kept and accessible using systemctl. Just add a startAt definition to your systemd service.
N. On Sun, Jul 12, 2015 at 10:23 PM Jeffrey David Johnson <[email protected]> wrote: > I see here that there are upstream issues with cron as far as setting user > crontab entries: > > http://lists.science.uu.nl/pipermail/nix-dev/2014-September/014120.html > > But I'm having trouble setting the system ones as well. I think if they > didn't work > at all a lot of other things would fail, so I must be setting something > wrong. This > simple test doesn't put any files in /tmp or send any emails: > > services.cron = { > enable = true; > mailto = "[email protected]"; > systemCronJobs = [ > "* * * * * test ls -l / > /tmp/cronout 2>&1" > "* * * * * > /nix/store/wc472nw0kyw0iwgl6352ii5czxd97js2-coreutils-8.23/bin/test > /nix/store/wc472nw0kyw0iwgl6352ii5czxd97js2-coreutils-8.23/bin/ls -l / > > /tmp/cronout 2>&1" > ]; > }; > > I've checked that it does get written to /etc/crontab: > > SHELL=/nix/store/xlxjcjq3bnbwnzq82irlzwxhmx6fvc2w-bash-4.3-p33/bin/bash > > PATH=/nix/store/fpqvi360cimx3h1kxdxfvkyip52d1i8y-system-path/bin:/nix/store/fpqvi360cimx3h1kxdxfvkyip52d1i8y-system-path/sbin > MAILTO="[email protected]" > > NIX_CONF_DIR=/etc/nix > * * * * * test ls -l / > /tmp/cronout 2>&1 > * * * * * > /nix/store/wc472nw0kyw0iwgl6352ii5czxd97js2-coreutils-8.23/bin/test > /nix/store/wc472nw0kyw0iwgl6352ii5czxd97js2-coreutils-8.23/bin/ls -l / > > /tmp/cronout 2>&1 > > And that the test and ls binaries are on that PATH. Anything else I should > try? > Jeff > _______________________________________________ > nix-dev mailing list > [email protected] > http://lists.science.uu.nl/mailman/listinfo/nix-dev >
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
