Sponsored Content
Top Forums Shell Programming and Scripting Run the script continously but mail once in 1 hour Post 302928920 by derekludwig on Tuesday 16th of December 2014 07:23:14 AM
Old 12-16-2014
Anusha,

The reason I asked for the O/S is that Solaris-1x and RHEL-7.x have mechanisms to restart services. But your system is running RHEL-5.8.

You need to determine how quickly you need to respond to a dead queue manager. There is no such thing as instantly. For non-production, every ten to fifteen minutes would be reasonable.

As far as checking, why not just check for everything is not running:
Code:
HOST=$(uname -n)
FILE=$(mktemp)
trap "rm -f ${FILE}" EXIT
dspmq | grep -v Running > ${FILE}
if [[ -s "${FILE}" ]]; then
  mailx -s "${HOST}: queue manager is down" "${@}" < ${FILE}
fi

As far as re-alerting in an hour ... why? As RudiC stated, if you need to be renotified every hour that a queue manager is down, then you only need to check once an hour. Remember, there is no guarantee that the first notification will be noticed. I think a more robust (and simpler) method would be to check every 10 minutes and notify any time a queue manager is down.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script should run continously

Hi I have a small req. I have a script called as abc.sh I want to execute this script continously for every 1 minute even if i exit from the server i.e., it should keeps on running for every one minute even if i logged off Can any one send me the sample code or procedure to work... (3 Replies)
Discussion started by: pssandeep
3 Replies

2. Shell Programming and Scripting

Run a script on the hour but only for 30mins

Hi All, I want to run a script on the hour during a 24 - hour period; easy enough cron will take care of that..however I want the script to only run for only 30mins.. so with the script it knows its 30mins are up so exits. any ideas? Any help, greatly appericated. Thanking you all... (2 Replies)
Discussion started by: Zak
2 Replies

3. Shell Programming and Scripting

Finding mail per hour

Hi, i have a logfile of a mail server it looks like this: d k 1004210238.380677500 1004210238.454490500 1004210238.679567500 3621 <VOLENDAM@Malawi.com> local.EDAM@Frankrijk.com 6053 81 I have got the following script to set the time in normal gmt time and to filter de failed messages, but i... (2 Replies)
Discussion started by: Prince2
2 Replies

4. Shell Programming and Scripting

How to run the particular command continously for 30 mins in perl?

Hi, I have command that should run continuously for 30 mins but not every day not once in a week , not one in a month. whenever i call that particular program that command should run for 30 mins and stop. #Contents of test.pl `ls -l *.txt`; #some other lines of code to print ... (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

Script for checking files for last hour and send a mail

Hello, I need to write a script to check the files in one folder , if that folder doesn't have files generated from last 1 hr then we need to send mail to particular persons. So Can you please help me to write script to check the files and send email. Thank you.. (1 Reply)
Discussion started by: archana23
1 Replies

6. Shell Programming and Scripting

E-mail based on crontab hour

I have a cron: 0 5,11,17,23 * * * /home/oracle/scripts/sysize.ksh This cron will trigger cat dbsz.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS I don't want to get the e-mail notice 4 times a day. Can I have just one e-mail triggered at 11 AM? Please advise. Thank you (3 Replies)
Discussion started by: Daniel Gate
3 Replies

7. Shell Programming and Scripting

How to run script automatically every 12 hour once?

Hi ! all, I have once script to remove temporary cache and temporary xml files looks like this, as it is taking more space, I would like to run automatically every 12 hour once, and then I want to receive some log as acknowledgement #!/bin/sh echo "Removing logs and temp files (typically... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

8. Shell Programming and Scripting

To run a job for every one hour and ...

Hi, Someone please help me to run the script to maintain a Job: Which can be run for every one hour and should maintain the last two hours files only. It should delete the rest of the files in a dir. Please suggest me with the sample script. Thanks !! Reagrds, Rama (5 Replies)
Discussion started by: ramagore85
5 Replies

9. Shell Programming and Scripting

Shell script to be run every one hour

How can we run shell script every one hour. Anyone having code unit for this? (1 Reply)
Discussion started by: Pratiksha Mehra
1 Replies

10. Shell Programming and Scripting

A shell script to run a script which don't get terminated and send a pattern from the output by mail

Hi Guys, I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies
MQSERIES_BACK(3)							 1							  MQSERIES_BACK(3)

mqseries_back - MQSeries MQBACK

SYNOPSIS
void mqseries_back (resource $hconn, resource &$compCode, resource &$reason) DESCRIPTION
The mqseries_back(3) (MQBACK) call indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work are deleted; messages retrieved as part of a unit of work are rein- stated on the queue. Using mqseries_back(3) only works in conjunction with mqseries_begin(3) and only function when connecting directly to a Queueu manager. Not via the mqclient interface. PARAMETERS
o $hConn -Connection handle.This handle represents the connection to the queue manager. o $compCode -Completion code. o $reason -Reason code qualifying the compCode. RETURN VALUES
No value is returned. EXAMPLES
Example #1 mqseries_back(3) example <?php mqseries_back($conn, $comp_code, $reason); if ($comp_code !== MQSERIES_MQCC_OK) { printf("CompCode:%d Reason:%d Text:%s<br> ", $comp_code, $reason, mqseries_strerror($reason)); } ?> NOTES
Note mqseries_back(3) will not function when using MQSeries Client to connect to a Queueu Manager. SEE ALSO
mqseries_conn(3), mqseries_connx(3), mqseries_begin(3). PHP Documentation Group MQSERIES_BACK(3)
All times are GMT -4. The time now is 02:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy