LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-01-2002, 11:01 AM   #1
bspicer
LQ Newbie
 
Registered: Apr 2002
Posts: 26

Rep: Reputation: 15
Cron sending mail to root


I have a cron job that executes a nightly backup.job listed below.

logfile=/eci/log/Backup.`date | cut -c1-3`
echo Backup began at `date` > $logfile
rm -f /eci/sql/*.dat
tar -cvf /dev/st0 -b 128 /eci >> $logfile
echo Backup ended at `date` >> $logfile


My problem is it mails the information below to root after each job. How can I stop this.


From root Thu Apr 25 22:00:12 2002
Return-Path: <root@localhost.localdomain>
Received: (from root@localhost)
by localhost.localdomain (8.11.6/8.1
for root; Thu, 25 Apr 2002 22:00:12
Date: Thu, 25 Apr 2002 22:00:12 -0500
Message-Id: <200204260300.g3Q30Ct02639@local
From: root@localhost.localdomain (Cron Daemo
To: root@localhost.localdomain
Subject: Cron <root@beneldo> /eci/bin/backup
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Status: RO

tar: Removing leading `/' from member names


Bill
 
Old 05-01-2002, 12:23 PM   #2
notsoevil
Member
 
Registered: May 2001
Location: Louisville, Kentucky, USA
Distribution: RedHat ES
Posts: 120

Rep: Reputation: 15
In your crontab file, you probably have the following lines (or similar):

Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
Note the 'MAILTO' line?

<snippet from crontab(5)>
Code:
       In addition to LOGNAME, HOME, and SHELL, cron(8) will look
       at MAILTO if it has any reason to send mail as a result of
       running  commands  in  ``this''  crontab.   If  MAILTO  is
       defined (and non-empty), mail  is  sent  to  the  user  so
       named.   If  MAILTO  is  defined but empty (MAILTO=""), no
       mail will be sent.  Otherwise mail is sent to the owner of
       the  crontab.   This  option  is  useful  if you decide on
       /bin/mail instead of /usr/lib/sendmail as your mailer when
       you  install  cron  --  /bin/mail doesn't do aliasing, and
       UUCP usually doesn't read its mail.
</snippet>

Learn to use man -- man is your best friend.

Good luck!

Last edited by notsoevil; 05-01-2002 at 12:24 PM.
 
Old 05-01-2002, 12:52 PM   #3
bspicer
LQ Newbie
 
Registered: Apr 2002
Posts: 26

Original Poster
Rep: Reputation: 15
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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
Sending output to mail account through cron. gian2oo1 Slackware 2 01-18-2005 12:54 PM
Sending Mail via cron every hour without user input. cpope67 Linux - Software 1 10-25-2004 01:55 PM
Who is Cron and why is he sending me all this mail?... lhoff Linux - Newbie 3 03-06-2002 04:40 PM


All times are GMT -5. The time now is 06:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration