Sponsored Content
Top Forums Shell Programming and Scripting Capturing the killed process logs Post 302696457 by murali1687 on Wednesday 5th of September 2012 04:10:36 AM
Old 09-05-2012
Capturing the killed process logs

I have two set of questions.
1) To skip killing some process automatically.

2) To kill other process and capture their log.

I have set of process, some needs to be killed gracefully and others should be skipped.

Listed are the process.
Code:
 
adm 1522 ABC_DE-BillingAgreement-2012-07-11-Agreement.tra
adm 1939 ABC_DE-GenesisHTTPandSOAPAdapter-2012-05-19-Genesis_Process.tra
adm 2729 ABC_DE-SpecialKenan-2012-05-17-Kenan_Archive.tra

adm 2729 ABC_DE-Gracefull-2012-05-17-Grace-Process.tra 
adm 2729 ABC_DE-Peacefull-2012-05-17-Peace-Process.tra


To Skip killing some process :
====================
From the above listed process first 3 process should not be killed, and others should be killed gracefully.
For which i have the below script. Can any one tell me if it works (or) needs any modifications.
Code:
grep -v -E "BillingAgreement | GenesisHTTPandSOAPAdapter | SpecialKenan" inputfile | cut -d" " -f2 | xargs kill

To capture the logs of other killed processes:
==============================
Logs are located in "/var/prod/logs" directory as
Code:
ABC_DE-Gracefull-2012-05-17-Grace-Process.log
ABC_DE-Peacefull-2012-05-17-Peace-Process.log

The killed processes get re-started automatically.
Once the process are killed,they logs will read as "stopped" and once re-started it reads as "started"
Example:
Code:
ENGINE-002 Engine  ABC_DE-Gracefull-2012-05-17-Grace-Process stopped
ENGINE-002 Engine  ABC_DE-Gracefull-2012-05-17-Grace-Process started

ENGINE-001 Engine  ABC_DE-Peacefull-2012-05-17-Peace-Process stopped
ENGINE-001 Engine  ABC_DE-Peacefull-2012-05-17-Peace-Process started

How can i capture these logs once they have stopped (or) started.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

process not getting killed

I have a process that is in the sleeping state "S" and I have tried to stop it with a run control script that I use to stop/start it - but it does not stop. I have tried kill -9 <PID of process> with no change. I imagine that this process is sleeping with the kernel. It does not respond to... (5 Replies)
Discussion started by: finster
5 Replies

2. Solaris

how to run a killed process

hi, i am creating a daemon process for updating the file at regular interval.one problem with this is if anybody kills the daemon it wont update the file.anybody have idea how to rerun the daemon if it killed.the code is written in c++ in solaries environment. thnaks & regards suresh (8 Replies)
Discussion started by: suresh_rtp
8 Replies

3. UNIX for Dummies Questions & Answers

SAS Process Getting Killed

HI all, I am very new to AIX (matter of fact Unix). We are currently automating out manual process using Unix Shell Scripting. My wrote a shell script which will accept the name of the sas job as parameter, checks the existense of the sas file in the specified folder. If it is not present,... (1 Reply)
Discussion started by: anubhav2020
1 Replies

4. UNIX for Dummies Questions & Answers

Protect a Process from Being Killed

Hi, I have a process which takes 13-15 mins for execution and its getting killed in the meantime.So can you please helpme out how to protect the process from getting killed. Thanks in advance. Regards, Harika (9 Replies)
Discussion started by: harikagrp
9 Replies

5. Shell Programming and Scripting

Capturing FTP logs

Hi Guys, I am trying to capture the FTP Logs in a log file. I am using the below code. ftp -d -n -v $Remote_Host << EOD > $Ftp_LOG; Since iam running the script in debug mode, i am able to see that the ftp is done and the file has been transferred. But the log file does not have... (7 Replies)
Discussion started by: mac4rfree
7 Replies

6. UNIX for Dummies Questions & Answers

Process Killed : Need to find why ?

Hi reader, I'm making a tool out of korn shell script that is running on a HP-UX server. But everytime i invoke the tool, it gets killed after a while (mid-process). I have tried re-running it a couple of times but each invocation ending up the same way .. following is a snippet of the o/p... (8 Replies)
Discussion started by: clakkad
8 Replies

7. Emergency UNIX and Linux Support

Capturing console (/dev/ttyS1) logs

Hi, I have been trying to capture console logs from the init script. When the ramfs is mounted, i check if usb is connected , if conncted, i mount it and redirected the console logs like so: cat & /dev/ttyS1 >> /mnt/logs.txt I'm getting /bin/sh : /dev/ttyS1 :permission denied ... (8 Replies)
Discussion started by: xerox
8 Replies

8. Shell Programming and Scripting

Help in capturing Time from Autosys Logs

Hi Guys, I'm very new to Shell scripting and have to design a code which I'm not able to find a way to. I will try to explain the aim in detail and shall be obliged if anyone could help me with the coding snippet. I have an input file who's every row has a few details about an autosys Job. I shall... (0 Replies)
Discussion started by: Crusnik02
0 Replies

9. UNIX for Beginners Questions & Answers

Help with Capturing time from Autosys logs

Hi Guys, I'm very new to Shell scripting and have to design a code which I'm not able to find a way to. I will try to explain the aim in detail and shall be obliged if anyone could help me with the coding snippet. I have an input file who's every row has a few details about an autosys Job. I shall... (1 Reply)
Discussion started by: Crusnik02
1 Replies

10. Shell Programming and Scripting

Shell script for capturing FTP logs

I have a script #!/bin/bash HOST=ftp.example.com USER=ftpuser PASSWORD=P@ssw0rd ftp -inv $HOST <<EOF user $USER $PASSWORD cd /path/to/file mput *.html bye EOF the script executes sucessfully I need to capture the FTP logs to a logfile should contain FTP Login successful ... (1 Reply)
Discussion started by: rajeshas83
1 Replies
MPI_Sizeof(3)							     Open MPI							     MPI_Sizeof(3)

NAME
MPI_Sizeof - Returns the size, in bytes, of the given type SYNTAX
Fortran Syntax INCLUDE 'mpif.h' MPI_SIZEOF(X, SIZE, IERROR) <type> X INTEGER SIZE, IERROR INPUT PARAMETER
X A Fortran variable of numeric intrinsic type (choice). OUTPUT PARAMETERS
SIZE Size of machine representation of that type (integer). IERROR Error status (integer). DESCRIPTION
MPI_SIZEOF returns the size (in bytes) of the machine representation of the given variable. It is a generic Fortran type and has a Fortran binding only. This routine is similar to the sizeof builtin in C/C++. However, if given an array argument, it returns the size of the base element, not the size of the whole array. NOTES
This function is not available in C/C++ because it is not necessary. ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. See the MPI man page for a full list of MPI error codes. 1.4.5 Feb 10, 2012 MPI_Sizeof(3)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy