LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 11-29-2010, 03:35 PM   #1
pgte3
Member
 
Registered: Aug 2004
Posts: 62

Rep: Reputation: 15
cron output


When a redirect (">") is not used in a crontab statement (below), where does the output, messages, results etc go?

45 23 * * *
/home/anpacadmin/scripts/medicare/chk4response17373
 
Old 11-29-2010, 03:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
The output is endless to the user defined in the mailto variable, usually root by default. This can cause some ugly situations when scripts are quite noisy and can easily fill up filesystems over time.
 
Old 11-29-2010, 03:59 PM   #3
pgte3
Member
 
Registered: Aug 2004
Posts: 62

Original Poster
Rep: Reputation: 15
In the below sample, is $HOME/backup.out mailed to dba?

#My Cron file.. User:MySQL
#use /bin/sh to run commands, overriding the default SHELL=/bin/sh
#
# mail any output to `dba'
MAILTO=dba
#
# fifteen minutes after midnight.. Backup it Up !!!
15 0 * * * $HOME/bin/backup.job >> $HOME/backup.out 2>&1


In my cron statement (previous post), I have no ">>", does that mean that there is nothing to mail? The output from the running a script goes?
 
Old 11-29-2010, 04:11 PM   #4
pgte3
Member
 
Registered: Aug 2004
Posts: 62

Original Poster
Rep: Reputation: 15
Should have included this in post, mailto variable is set to MAILTO=""
 
Old 11-29-2010, 04:35 PM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by pgte3 View Post
In my cron statement (previous post), I have no ">>", does that mean that there is nothing to mail?
Not really. The output can be redirected to a file inside the script itself. In that case there is nothing sent to the standard output (or the standard error) and redirection in the crontab entry is not necessary.
Quote:
Originally Posted by pgte3 View Post
Should have included this in post, mailto variable is set to MAILTO=""
In this case the output is lost forever.
 
Old 11-30-2010, 03:21 PM   #6
pgte3
Member
 
Registered: Aug 2004
Posts: 62

Original Poster
Rep: Reputation: 15
ok thanks
 
  


Reply


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
Cron output to .log investmentbnker75 Programming 14 04-28-2008 08:09 AM
cron output yusufs Linux - Newbie 3 11-30-2007 06:28 AM
cron output nelamvr6 Linux - Newbie 3 10-18-2005 08:11 PM
cron output? sk8guitar Linux - General 4 08-15-2003 02:55 PM
Understanding CRON output lhoff Linux - General 1 05-19-2003 02:17 PM


All times are GMT -5. The time now is 12:58 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration