The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
Debian: doubt in "top" %CPU and "sar" output jaduks Debian 0 09-12-2007 08:05 AM
Unix "at" / "Cron" Command New Problem...Need help Mohanraj UNIX for Dummies Questions & Answers 3 01-26-2006 08:08 PM
Running "wall" command from cron xadamz23 Shell Programming and Scripting 1 05-27-2005 08:43 PM
Pine UNIX email -- old messages labeled "New" sean_oconnor UNIX for Dummies Questions & Answers 1 08-01-2001 01:55 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-10-2005
loeng loeng is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 4
Duplicate output from "cron" messages

Few days ago I tried to fix an error in the crontab entry, basically I just add the complete path to run a script and remove an unused script from the crontab. I use crontab -e and mv FIFO FIFO.old command then cron start as cron won't start until I delete or move FIFO. I didn't know that using crontab -e should be enough.

Since then, I got duplicate messages regarding with output from "cron" messages. Even, I got report from scripts that I have already removed from the cron jobs. Can someone help me why it happens and how to solve this problem?

Another question is about >/dev/null 2>&1. I thought by adding this text to the last of a line in a crontab will avoid crontab from sending Output from "cron" message. However, I still get the message. Did I miss something ?
  #2 (permalink)  
Old 11-11-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Do a
Code:
ps -ef|grep cron|grep -v grep
see if there are two cron daemons running (sure sounds like there are).

You stated you moved FIFO to FIFO.old (the original cron is using it which is why your old cron jobs are still running). You didn't state you stopped cron from running.

You then started cron (another one) - duplicate jobs.

And I haven't heard of putting >/dev/null 2>&1 at the end of a crontab file to make all the entries not send mail/output. I've always thought is was on each line that it was needed.
  #3 (permalink)  
Old 11-12-2005
loeng loeng is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 4
Re: Duplicate output from "cron" messages

You're right.

Following is the output if I run the command: ps -ef | grep cron | grep -v grep
root 5217 1 0 Nov 07 ? 0:05 cron start
root 19921 1 0 Nov 04 ? 0:07 cron start
root 22232 1 0 Nov 08 ? 0:05 cron stop
root 6368 1 0 Nov 07 ? 0:05 cron start
root 5667 1 0 Nov 07 ? 0:06 cron start
root 22304 1 0 Nov 08 ? 0:05 cron stop
root 6704 1 0 Nov 07 ? 0:05 cron start
root 26238 1 0 Nov 01 ? 0:08 /usr/sbin/cron
root 7289 1 0 Nov 07 ? 0:05 cron start
root 19916 1 0 Nov 04 ? 0:07 cron stop
root 22368 1 0 Nov 08 ? 0:05 cron start


I've killed all the process, except for the following three:
root 22304 1 0 Nov 08 ? 0:05 cron stop
root 26238 1 0 Nov 01 ? 0:08 /usr/sbin/cron
root 22368 1 0 Nov 08 ? 0:05 cron start

Should I kill 22304 and 22368?

I've also deleted FIFO.old
  #4 (permalink)  
Old 11-12-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
You should probably kill all of it since it is so messed up. A reboot may even be a better idea. I've never seen cron start and cron stop out there like that.
  #5 (permalink)  
Old 11-12-2005
loeng loeng is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 4
Re: Duplicate output from "cron" messages

I've killed all the process and I started a new process by running
/usr/sbin/cron start

The output of ps -ef| grep cron | grep -v grep is as follow:
root 5255 1 0 14:19:09 ? 0:00 /usr/sbin/cron start

If this still doesn't work, I will ask for my supervisor's permission to reboot the server.
  #6 (permalink)  
Old 11-13-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
A reboot would clean up everything, but the real problem is the way you are stopping and starting cron. Look at the man page for cron - there is no option for start (or stop). It even mentions that cron should only be executed once.

You need to use the startup script - look in /etc/rc2.d for S75cron
(the number could be different) - use it. /etc/rc2.d/S75cron start

You also can use it to stop cron /etc/rc2.d/S75cron stop
  #7 (permalink)  
Old 11-13-2005
loeng loeng is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 4
Re: Duplicate output from "cron" messages

Thanks,

I think it's fine now. I just kill cron start process and run /usr/bin/cron instead.

I'm just wondering about cron stop and cron start. I saw a few sites still telling us to do this command to restart cron. Is this only valid for previous version of Solaris ??
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0