03-16-2016
Grep the 'not running' jobs and will send the update in mail with its name(job)
my request is:
i have to create a script , which will grep the 'not running' jobs and will send the update in mail with its name(job)
Scenario:
logged in to machine abc
went to particular path: cd /a/b/c
then ./script1.sh status (script.sh is a script,whose status gives info about 10 jobs whether they are running or not running)
my idea is: ./scripts.sh status | grep not
so help me to create another script that grep the 'not running' from script.sh status and send the mail with the job name.
NOTE: this script should run in every 15 mins
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
We now have a Log file which has time stamps of all the scripts ran. It has start
time and end time. I now have a requirement to send mail to the Admin after the script finishes running.
Can some one help me with a Script which will send mail with Start time and
End time of the... (2 Replies)
Discussion started by: srikanthgr1
2 Replies
2. UNIX for Dummies Questions & Answers
Hi
The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment .
cat Employee.sql
SET VERIFY OFF
SET PAGESIZE 200
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies
3. AIX
Hi,
I am facing a (for me and coworkers) strange behaviour. When I stop sendmail on a plain AIX 5.3 testing box (there is definetly no sendmail process left running anymore), I am still able to send mails to remote addresses via the mail command. I tried that on another box which is not a... (6 Replies)
Discussion started by: zaxxon
6 Replies
4. Shell Programming and Scripting
Hi,
I am trying to call sql script from ksh job with parameters.The parameters passed from ksh job will be used in SELECT query in sql file to SPOOL the data in extract file.My questions are:
1) How to call a sql script from ksh job with parameters?
2) How to use the parameter in sql file to... (1 Reply)
Discussion started by: anil029
1 Replies
5. UNIX for Advanced & Expert Users
i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail.
actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies
6. Shell Programming and Scripting
how to run a script using cron job and send the output as attachment via e-mail using unix. please help me.
how my cron job entry should be?
As of now my cron job entry is to run the script at specific time,
15 03 * * * /path/sample.sh | mail -s "Logs" email_id
In the above entry, what... (8 Replies)
Discussion started by: vidhyaS
8 Replies
7. Shell Programming and Scripting
I want to search a file if it contains special strings and if yes, the records found should be mailed.
I can either do it with a temporary file:
/usr/bin/grep somestring somefile > /tmp/tempfile && /usr/bin/mail -s "Found something" email@mycomp.com < /tmp/tempfile... or by running the grep... (10 Replies)
Discussion started by: Cochise
10 Replies
8. UNIX Desktop Questions & Answers
I have set up a cron, which will send the mail with not runnnig jobs in the script.sh
15,30,45 * * * * /a/b/c/script.sh | grep not | mail -s "test mail" learner987@gmail.com
But i dont want mail when all the jobs are running, but with the above cron i will get mails without the content(if all... (2 Replies)
Discussion started by: learner987
2 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using.
So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
10. UNIX for Advanced & Expert Users
I am having trouble getting mail to work on a red hat server. At first I was getting this message.
Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused
Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
qterm(8B) PBS qterm(8B)
NAME
qterm - terminate processing by a PBS batch server
SYNOPSIS
qterm [-t type] [server...]
DESCRIPTION
The qterm command terminates a PBS batch server. When a server receives a terminate command, the server will go into a terminating state.
While in this state, the server will not allow new jobs to be started or enqueued. By default, qterm will request a "quick" shutdown of
the PBS server. Other ways of shutting down the server (specified with the -t argument), and their impact on running jobs, are described
below. The qterm command will not exit until the server has completed its shutdown procedure.
In order to execute qterm, the user must have PBS Operation or Manager privilege.
OPTIONS
-t type Specifies the type of shut down. The types are:
immediate
All running jobs are to immediately stop execution.
If checkpoint is supported, running jobs that were submitted with "-c shutdown" are checkpointed, terminated, and
requeued. If checkpoint is not supported or the job cannot be checkpointed, running jobs are requeued if the rerunable
attribute is true. Otherwise, jobs are killed.
Normally the server will not shutdown until there are no jobs in the running state. If the server is unable to contact
the MOM of running job, the job is still listed as running. The server may be forced down by a second qterm -t immediate
command.
delay If checkpoint is supported, running jobs that were submitted with "-c shutdown" are checkpointed, terminated, and
requeued. If a job cannot be checkpointed, but can be rerun, the job is terminated and requeued. Otherwise, running jobs
are allowed to continue to run. Note, the operator or administrator may use the qrerun and qdel commands to remove run-
ning jobs.
quick This option is used when you wish that running jobs be left running when the server shuts down. The server will cleanly
shutdown and can be restarted when desired. Upon restart of the server, jobs that continue to run are shown as running;
jobs that terminated during the server's absence will be placed into the exiting state.
OPERANDS
The server operand specifies which servers are to shutdown. If no servers are given, then the default server will be terminated.
STANDARD ERROR
The qterm command will write a diagnostic message to standard error for each error occurrence.
EXIT STATUS
Upon successful processing of all the operands presented to the qterm command, the exit status will be a value of zero.
If the qterm command fails to process any operand, the command exits with a value greater than zero.
SEE ALSO
pbs_server(8B), qmgr(1B), pbs_resources_aix4(7B), pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), and
pbs_resources_unicos8(7B)
Local qterm(8B)