LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   redirecting output of cron job (https://www.linuxquestions.org/questions/linux-newbie-8/redirecting-output-of-cron-job-907539/)

qrange 10-11-2011 04:33 AM

redirecting output of cron job
 
I have a simple script to monitor the CPU temperature and need it to run in cron.
it should send output to a file and not send email.

I've tried the following:

Code:

27 * * * * /home/djordje/bin/CPUt >> /home/djordje/CPUtemp.log  > /dev/null 2>&1

but it doesn't work. how to solve it?

thanks.

ModServ 10-11-2011 04:38 AM

Hello,

Why using this ?

/dev/null 2>&1

Make it like below:

Code:

27 * * * * /home/djordje/bin/CPUt >> /home/djordje/CPUtemp.log

lithos 10-11-2011 05:34 AM

well, maybe redirecting all output to a file instead of /dev/null will do the work
Code:

27 * * * * /home/djordje/bin/CPUt 2>&1 >> /home/djordje/CPUtemp.log


All times are GMT -5. The time now is 11:38 AM.