Email engine cron problem.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Email engine cron problem.
# 1  
Old 11-10-2010
Email engine cron problem.

We have an email engine in our corporation which is installed in Solaris based machine. It is currently facing delays in transactions. So a temporary work around was deployed that is a cronjob was made for restarting email engine every hour. We tested in lab system and it worked pretty okay but in production it failed. Cronjob executes every hour saying killed but actually the process for email engine do not get killed.
Following is the cron we made for the email engine killing script:
Code:
30 * * * * /opt/remedy/ar/AREmail/email_kill.sh

and script content is:

Code:
#! /usr/bin/ksh
PID= `ps -eaf | grep AREmail | grep -v grep | awk '{print $2}'` > /opt/remedy/ar/AREmail/email_kill.out 2>&1'

kill -9 "$PID"


Last edited by nixhead; 11-11-2010 at 01:54 AM..
# 2  
Old 11-10-2010
do some logging from the process...

That is by, adding print statement for PID and check whether it gets the correct PID. And the script has the required permissions to kill that process.
This User Gave Thanks to thegeek For This Post:
# 3  
Old 11-10-2010
Yeah I have taken print for that and it is taking some different PID. I have given it appropriate permissions to do so.
# 4  
Old 11-10-2010
30 * * * * /opt/remedy/ar/AREmail/email_kill.sh
# 5  
Old 11-10-2010
Quote:
Originally Posted by teeyang
30 * * * * /opt/remedy/ar/AREmail/email_kill.sh
I didn't get you.
# 6  
Old 11-10-2010
First reaction is that the script is probably killing itself! The script invocation line includes the string "AREmail".
Try including:
Code:
grep -v "email_kill.sh"

Also the shebang line (1st line of the script is wrong).
should be
Code:
#!/usr/bin/ksh


It is rarely ever necessary to issue "kill -9" on a unix system. Are you sure that there is no tidier way to close the process?
# 7  
Old 11-11-2010
Sorry I made writing error here. Now the original content is in question.
So could any one can figure out why doest it happening?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

2. Shell Programming and Scripting

I want to send an email after cron job

I am using centos 6.4. I have a few cron jobs setup and they all work fine. However, I would like to enhance one of the crons. This is what I have at the moment: nice rsync -au /home/samba/wsaler/* /home/samba/wsaler.backup/wsaler.backup18pm date | /bin/mail -s "wsaler 3:00pm backup... (8 Replies)
Discussion started by: countrydj
8 Replies

3. Solaris

Facing problem with installing CF engine software in solaris 10

Dear experts, I am using solaris 10 OS.I am installing CF engine software in the server while doing so ,i am getting following error checking for BerkeleyDB location in default... configure: error: >> Cannot find BerkeleyDB I am installing the Berkely DB 5.3.I am strugging... (1 Reply)
Discussion started by: muraliinfy04
1 Replies

4. Red Hat

Email program using CRON

Hi Guys... I have a bulk email program that sends out an email to a subscribed mail list. The list contains around 2000 addresses. My server is Centos 5 64bit PHP 5.2 Mysql 5.1 The program is set to send emails in batches of 100. Cron is set to run every minute Now for the problem:... (2 Replies)
Discussion started by: countrydj
2 Replies

5. Shell Programming and Scripting

Cron Job Automated Email Alternatives?

Hi guys, not sure if this would be the right place for this but I dont where else it would go... I'm new to Unix too, so please bare with me :) I guess first up some background on the situation. We have some scripts that run as cron jobs which monitor and check the health, etc of our servers.... (2 Replies)
Discussion started by: BrianD
2 Replies

6. UNIX for Dummies Questions & Answers

Cron to delete email help needed

I would like to know if I can place a cron job (and what it might be of course) to delete all the mail in an inbox? Here are the servers specs: Operating systemLinuxService StatusClick to ViewKernel version2.6.28.9Machine Typei686Apache version2.2.11 (Unix)PERL version5.8.8Path to... (2 Replies)
Discussion started by: markmatu
2 Replies

7. AIX

Cron Job notification email

Hi, I'm fairly new to Aix and am looking for some help on the following. I have setup a cron job under root and want it to send the email once it's run to an external email address. I can get it to send the output in an email to me by using mail on the end of the crontab entry. But I would... (1 Reply)
Discussion started by: elmesy
1 Replies

8. AIX

Problem with Cron Email Notification

I have two different cron jobs that run on the same days. The jobs are 7 hours apart. Both jobs are set to send notification emails when they start running. Both jobs always run successfully, but I only receive an email from the first job. I never get the email from the second job. ... (1 Reply)
Discussion started by: sasaliasim
1 Replies

9. UNIX for Dummies Questions & Answers

Cron Email Problem

I have two different cron jobs that run on the same days. The jobs are 7 hours apart. Both jobs are set to send notification emails when they start running. Both jobs always run successfully, but I only receive an email from the first job. I never get the email from the second job. ... (0 Replies)
Discussion started by: sasaliasim
0 Replies

10. UNIX for Dummies Questions & Answers

email when cron fails

I have a cronjob scheduled to run everyday. How can I obtain an email if and only if the cronjob fails? I am using Sun Solaris (ksh). :rolleyes: (7 Replies)
Discussion started by: inpavan
7 Replies
Login or Register to Ask a Question