LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-11-2011, 03:33 AM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

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:

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

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

thanks.
 
Old 10-11-2011, 03:38 AM   #2
ModServ
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Rep: Reputation: 2
Hello,

Why using this ?

/dev/null 2>&1

Make it like below:

Code:
27 * * * * /home/djordje/bin/CPUt >> /home/djordje/CPUtemp.log
 
1 members found this post helpful.
Old 10-11-2011, 04:34 AM   #3
lithos
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
Code:
27 * * * * /home/djordje/bin/CPUt 2>&1 >> /home/djordje/CPUtemp.log
 
1 members found this post helpful.
  


Reply



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 01:01 AM
cron job did not redirect output from bash script junust Programming 2 07-26-2009 04:30 AM
Way To Have Output Of Cron Job Emailed jmoschetti45 Linux - General 1 05-22-2007 01:42 AM
cron job mailing blank output rsmccain Linux - General 4 10-09-2006 04:00 PM
Problem displaying program output when driven by a cron job garmon Linux - Newbie 1 07-22-2004 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:29 PM.

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