I have a cron job and its output is now redirected into a file. It looks like the following
0 9 * * * /bin/sh /bin/cleanup.sh > /home/darkknight/cleanup.log
Running process has a PID and its fd (file descriptor) is mapping to /proc/
. And we can find PID of the running cron process at /var/run/crond.pid
.
To send cron log to stdout, we could write log to fd number 1 of the process started by cron.
0 9 * * * /bin/sh /bin/cleanup.sh > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1