LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2004, 02:10 PM   #1
cpope67
LQ Newbie
 
Registered: Oct 2004
Posts: 8

Rep: Reputation: 0
Question Why Does One Cron Job Run Twice?


I have a file that tests email setup in /etc/cron/hourly and it runs every hour. It still runs every hour but now it runs twice on the hour one second apart. Now I get two emails every hour. Why has it started doing this? It still works and this is one of those little bothersome things that just eat at you because you can't figure out what is going on. Anybody got an idea why it's doing this?

Last edited by cpope67; 11-10-2004 at 02:13 PM.
 
Old 11-10-2004, 02:24 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No symlinks to itself, or calling of itself, right? And it didn't get added to an extra crontab, did it?
 
Old 11-15-2004, 10:40 AM   #3
cpope67
LQ Newbie
 
Registered: Oct 2004
Posts: 8

Original Poster
Rep: Reputation: 0
No symlinks to itself, or call itself, I only have one crontab. This is all that it is doing:

echo "THIS IS A TEST EMAIL."|mail cpope@mwwssb.com -s"POSTAL `date`"
echo " " >> /root/logs/test.log
echo "POSTAL `date`" >> /root/logs/test.log
echo "EMAIL IS UP. HAVE A NICE DAY ">> /root/logs/test.log
echo " " >> /root/logs/test.log
 
Old 11-16-2004, 05:44 AM   #4
arvind_sv
Member
 
Registered: Oct 2002
Location: Bangalore
Distribution: Gentoo Linux
Posts: 96

Rep: Reputation: 16
Hi,

The first line in the script is sending a mail (to the mwwssb.com address). So, you get one mail.

Then, cron has this feature of mailing you the output of a program executed using crontab. So, run the program on the command-line and see if it outputs anything. If it does, the same output should appear in a mail (second one) to you.

If it does not output anything, post the relevant crontab lines here, and also the whole script being called. Also, post the bodies of the two mails.

Arvind
 
Old 11-16-2004, 06:09 AM   #5
akilles
Member
 
Registered: Sep 2004
Location: Vestfold, Norway
Distribution: Slackware
Posts: 139

Rep: Reputation: 15
/etc/cron/hourly > /dev/null
This stops sending a mail containing the output of the job.

-Geir
 
  


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
cron job only runs halfway aunquarra Linux - General 15 01-31-2005 04:53 PM
cron job? dr_zayus69 Linux - Newbie 14 12-01-2004 06:16 PM
CRON Job tommytomato Fedora 12 09-13-2004 12:38 AM
cron job ? johnyy Linux - Software 3 12-10-2003 06:00 PM
Cron job T-Rex Linux - Newbie 1 09-26-2001 11:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:16 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