Duplicate output from "cron" messages


 
Thread Tools Search this Thread
Operating Systems Solaris Duplicate output from "cron" messages
# 1  
Old 11-10-2005
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  
Old 11-11-2005
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  
Old 11-12-2005
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  
Old 11-12-2005
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  
Old 11-12-2005
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  
Old 11-13-2005
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  
Old 11-13-2005
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 ??
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. AIX

"Frames" and "Words" in fcstat output

What are "Frames" and "Words" in the fcstat output? vio1:/home/padmin:# fcstat fcs0 <snip> Transmit Statistics Receive Statistics ------------------- ------------------ Frames: 122844229 363445456 Words: 50940091904 171210861568 <snip> The... (1 Reply)
Discussion started by: kah00na
1 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

6. UNIX for Dummies Questions & Answers

Explanation of "total" field in "ls -l" command output

When I do a listing in one particular directory (ls -al) I get: total 43456 drwxrwxrwx 2 root root 4096 drwxrwxrwx 3 root root 4096 -rwxrwxr-x 1 nobody nobody 3701594 -rwxrwxr-x 1 nobody nobody 3108510 -rwxrwxr-x 1 nobody nobody 3070580 -rwxrwxr-x 1 nobody nobody 3099733 -rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

7. Solaris

significance of "+" char in SunOS "ls -l" output

Hi, I've noticed that the permissions output from "ls -l" under SunOS differs from Linux in that after the "rwxrwxrwx" field, there is an additional "+" character that may or may not be there. What is the significance of this character? Thanks, Suan (6 Replies)
Discussion started by: sayeo
6 Replies

8. Debian

Debian: doubt in "top" %CPU and "sar" output

Hi All, I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel). For my application: <sar -U ALL> CPU %user %nice %system %idle ... 10:58:04 0 153.10 0.00 38.76 0.00 10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
Discussion started by: jaduks
0 Replies

9. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies
Login or Register to Ask a Question