Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-11-2011, 04:33 AM   #1
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 994

Rep: Reputation: 47
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:

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

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

Old 10-11-2011, 04:38 AM   #2
LQ Newbie
Registered: Oct 2010
Posts: 12

Rep: Reputation: 2

Why using this ?

/dev/null 2>&1

Make it like below:

27 * * * * /home/djordje/bin/CPUt >> /home/djordje/CPUtemp.log
1 members found this post helpful.
Old 10-11-2011, 05:34 AM   #3
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
well, maybe redirecting all output to a file instead of /dev/null will do the work
27 * * * * /home/djordje/bin/CPUt 2>&1 >> /home/djordje/CPUtemp.log
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make root cron job to send email if there is output mirror51 Linux - Newbie 3 08-12-2009 02:01 AM
cron job did not redirect output from bash script junust Programming 2 07-26-2009 05:30 AM
Way To Have Output Of Cron Job Emailed jmoschetti45 Linux - General 1 05-22-2007 02:42 AM
cron job mailing blank output rsmccain Linux - General 4 10-09-2006 05:00 PM
Problem displaying program output when driven by a cron job garmon Linux - Newbie 1 07-22-2004 03:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration