LinuxQuestions.org
Help answer threads with 0 replies.
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 03-05-2004, 03:57 PM   #1
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Rep: Reputation: 30
why do I keep have a new mail on the user


Hi all,

I have a cronjob to be run every night to backup the database and I don't understand why I keep got the new mail on the user, below is some of the example on my mail:


From oracle Thu Mar 4 19:01:33 2004
Return-Path: <oracle@test.trx>
Received: (from oracle@localhost)
by test.trx (8.11.6/8.11.6) id i25100n04221
for oracle; Thu, 4 Mar 2004 19:00:00 -0600
Date: Thu, 4 Mar 2004 19:00:00 -0600
Message-Id: <200403050100.i25100n04221@test.trx>
From: root@test.trx (Cron Daemon)
To: oracle@test.trx
Subject: Cron <oracle@qhoudb03> /home/oracle/DBA_STUFFS/backup_scripts/HUPODD01/backup.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/oracle>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=oracle>



all of the backup run fine, what can I do to eliminate these mail???
 
Old 03-05-2004, 04:55 PM   #2
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
Cron mail

Cron sends the ouput from the command to you. To eliminate this, redirect the output from the command by adding 2&> /dev/null to your cron job.

/Odie

Last edited by OdieQ; 03-05-2004 at 04:58 PM.
 
Old 03-08-2004, 05:18 PM   #3
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
thanks for your reply.

How come it doesn't happen like this before??? All the sudden, I got those mails recently. Any way, could you please give me more detail of how to fix the problem???

thanks
 
Old 03-08-2004, 05:40 PM   #4
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
It only sends an email if there is any output from the command, so perhaps the command didn't genereate ouput before?

Did you try adding the '2&>/dev/null' to your cron job?
Edit your crontab (with crontab -e) and append the above to the end of the line containing the backup job. If you still get the emails, we need to dig further.
 
Old 03-08-2004, 06:40 PM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
You could also try biff n to stop your system telling you that you have new mail in /var/mail/ahsley. It won't stop the mail from being generated, but it'll stop telling you about it. Personally, I like having the mail generated, but I use Sylpheed to collect it so I don't want my terminal sessions telling me about it all the time.
 
  


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
New user can't get mail MoveZig Linux - Software 1 09-28-2005 09:38 AM
Mail going to /var/spool/mail/user and not to Thunderbird pracslipkerm Linux - Newbie 4 06-21-2005 05:58 AM
Qmail problem: ISP mail and virtual mail, "sorry no mailbox, here by that user" barryw Linux - Networking 7 05-28-2005 12:43 PM
Sendmail - one user getting all mail rob19 Linux - Software 0 04-07-2003 07:20 PM
/var/mail/$USER katana Linux - General 1 08-03-2001 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:08 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
Open Source Consulting | Domain Registration