AIX-Am new in ksh script While runing both the script getting below errors ---------- Post updated at 12:38 AM ---------- Previous update was at 12:07 AM ----------
tried below script want to add one more step to add duplicated job name at run time
Do you see it now?
The following reports all processes from user abcd with 10 or more instances
The following also filters for process name d.ksh or a.ksh
yes it is working fine please let me know below syntax
2..Also if you can add to send alert massage with running job name more then 10 time with their process ID,Will be fine
Basically the -o switch to ps allows you to select your own fields rather than use the defaults. This is particularly important in writing scripts that may be transferred to another platform, because the default selection of fields in ps -efwill be different if you move from Linux to Unix or MacOS X but ps -o will, with Yoda's caveats, most likely work. And if they don't, you will get an error rather than some odd misbehaviour that is hard to trace.
Multiple fields can be specified using a comma to separate each from the next. For instance, the default fields given by
on my Ubuntu system are equivalent to
but if I wanted the parent-pid and effective user-id instead of the tty and the time I could type
And by changing the order of the field names you change their order in the output.
Appending the equals sign (=) to a field name suppresses its heading in the final output. Note, though, that you have to suppress the heading of every field, for example:
I hope that makes sense.
Getting the PIDs of the processes in the alert could be more tricky. If you use my original suggestion and have pgrep on your system you could use pgrep within the loop to inject the PIDs into your message.
for below script below script matching my requirement.
doubt- is it possible to print job with process ID if not please ignore ---------- Post updated at 11:41 PM ---------- Previous update was at 07:42 PM ----------
HI I have almost near to my requirement
getting small issue need some correction while runing below script not fetching current runing full jobs name more then 10times
for example: runing more then time 10 time 3 different paths
For my server runing more then 100 jobs on different location/path using AIX operating system
While runing its fetching only ksh ,perl.java,c,pli like that not fetching full name of the jobs
Sure, you can add another -o pid= column, and you can change -o comm= to -o args=
Rule: put the predictable columns first, and have the args last!
The trailing = means "don't print a header for this column", and all columns = means "don't print a header line at all".
apmcd47 mentioned a shorter notation but I found it does not work everywhere.
Does it look more promising now?
Postprocessing of args is problematic because it contains spaces. In awk you cannot simply refer to column $2 because your process name might be in $3...
I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Hi,
I check if the process is running or not using the below.
/usr/ucb/ps auxww | grep 109 |grep rmi | awk '{print $2}'
9718
Thus we see 9718 is the PID.
It return blank if the process is not running.
I need to perform some action if the process is not running and leave it if... (8 Replies)
Hi,
Can anyone please tell me how to write a shell script to check
whether a process if running or not.... if its still running then wait for sometime and if not then run the next query.
Also, Under my one main script main.sh I have to run 2 scripts simutaneously which take some time to... (2 Replies)
How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that?
Thanks, (1 Reply)
Hi
I would like to check if an instance of a script is already running.
I've seen many different examples, but I haven't the slightest idea as to how to do this.
Can you please help.
Thank you. (5 Replies)
Hi ,
I have a csh code below which check the process if it's running.
Can any expert advise me on the following:
1) what does this notationmean ">!" and how is it different from the append ">" notation ?
2) how does "setenv" work in this code ?
# Check whether there is a running... (3 Replies)
How do I make a shell script to see if a certain process is running.
The process shows up on ps aux as /usr/sbin/daemon
eg:
if
/usr/sbin/daemon
else
#nothin
basically i want to run the process if it isnt running/ has been stopped.
Thanks. (2 Replies)
Hi,
I want to check whether the ftpd process is running or not.
Is there any solaris command that can help me in this?
Or is there any other way in which I can check this?
Is it possible to check programmatically (preferrably in a C++ code)?
Eagerly awaiting a reply.
Thanx. (8 Replies)
I have this script:
-------------------------------------------------------
#!/bin/ksh
#
if ] ||
]
then
echo "Executing main_load.sh script"
/usr1/psc_load/jobs/cron/main_load.sh "ods"
else
echo "File not found, do nothing"
fi
exit 0
... (4 Replies)