How to redirect cron job output to stdout

前端 未结 3 1738
不知归路
不知归路 2020-12-25 13:08

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

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-25 13:29

    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

提交回复
热议问题