How to redirect cron job output to stdout
问题 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 Can any one help me to rediect its output to stdout? 回答1: Enter tty on any terminal and we will get device file for that particular teminal window like /dev/pts/1 . Redirct the cron job into this file as cleanup.sh > /dev/pts/1 回答2: Running process has a PID and its fd (file descriptor) is mapping to /proc/<PID>/fd . And we can find PID