Keywords: fedora 20, systemd, cron, crond, output, stdout, journal
Problem: You want to capture and read the output of your cron jobs, but the output isn't being logged anywhere.
Solution: Add an argument to crond
.
Step 1. Open /etc/sysconfig/crond
for editing.
$ sudo nano /etc/sysconfig/crond
Step 2. Add the -s
switch to CRONDARGS
so that it looks like the following:
# Settings for the CRON daemon.
# CRONDARGS= : any extra command-line startup arguments for crond
CRONDARGS=-s
Step 2. Restart the crond
service.
$ sudo systemctl reload-or-restart crond.service
Step 3. Wait for crond
to run your cron job at the next scheduled interval. Afterwards, examine the journal for the output.
$ journalctl --boot | grep CMDOUT