Sponsored Content
Top Forums Shell Programming and Scripting Pls Help me out ... I want to check process status at regular intervals of time Post 302218791 by srinivasvandana on Saturday 26th of July 2008 05:56:12 PM
Old 07-26-2008
Java Pls Help me out ... I want to check process status at regular intervals of time

I want to check process status at regular interval of time ...
so i ha wirtten this BUT its not working when i placed this peace of code in .sh ..
please help me out

#!/bin/sh
w = ps -ef|grep processname | wc - l
echo $w
if [ $w -lt 3 ] ; then
Banner "Proceesname Problem"
else
Banner " Running Fine"
fi

Please help me out with necessary modification .
Thanks in advance...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

mailing myself at regular intervals...

hi all, i wrote a script to mail myself using pine (modified) to keep remind of b'days. #!/bin/bash grep "`date +%D |awk -F/ '{print $2+1, $1+0}'`" dataFile >/home/username/mailme if test -s /home/username/mailme then pine -I '^X,y' -subject "Birthday Remainder" username... (4 Replies)
Discussion started by: timepassman
4 Replies

2. Programming

performing a task at regular intervals

hi! i m tryin to write a program that will perform a specific tasks after fixed interval of time.say every 1 min. i jus donno how to go abt it.. which functions to use and so on... i wud like to add that i am dont want to use crontab over here. ny lead is appreciated. thanx. (2 Replies)
Discussion started by: mridula
2 Replies

3. Shell Programming and Scripting

Check process running Status with PID

Good day I am fairly new to Shell Scripting. I want a script to check if a process is up by checking the process's PID and then return a value for when it's running which would be 0. If it isn't running it should give any other value that 0. Any Help is appreciated Regards (9 Replies)
Discussion started by: 1nsyz1on
9 Replies

4. Shell Programming and Scripting

How to Check the process Status and do something

Hi we have weblogic deployed under Linux Enterprise 5 . Now i want to write a script that checks if weblogic is running or not I have found that weblogic uses Java as process . Can i do this way : my Script File : Echo Checking Status if then echo Server Running else echo... (2 Replies)
Discussion started by: Ravi Pavanv
2 Replies

5. Shell Programming and Scripting

How to check the process status

Hi, I have a cron job which runs every ten minutes, now i hav to check the process whether it is running or not only once and then this should be sent to a log file.. crontab : 00,10,20,30,40,50 * * * * a process check ps = 'ps -ef |grep a ' if then echo " Success" >... (3 Replies)
Discussion started by: NehaKrish
3 Replies

6. Shell Programming and Scripting

Remove a block of Text at regular intervals

Hello all, I have a text files that consists of blocks of text. Each block of text represents a set of Cartesian coordinates for a molecule. Each block of text starts with a line that has a only a number, which is equal to the total number of atoms in the molecule. After this number is a line... (15 Replies)
Discussion started by: marcozd
15 Replies

7. Programming

Selecting files in regular intervals from a folder

Hi, I need your expertise in selecting files from a folder. I have files named with convention: filename.i.j where j is an interger from 1 to 16, for each i which is an integer from 1 to 2000. I would like to select the files with i in regular interval of 50 like filename.1.j,... (2 Replies)
Discussion started by: rpd25
2 Replies

8. UNIX for Dummies Questions & Answers

Bulk load testing in regular intervals

I need to write a script which can send files via sftp communication continously for half an hour or any given duration of time. I have already written a batch file to send multiple file via SFTP. but I need to know how can we set a duration of half an hour through shell script. Can we use sleep... (2 Replies)
Discussion started by: talk1234
2 Replies

9. Shell Programming and Scripting

Script to check process status

Hi Team, I am using redhat 6.4 version server.We have a script which is used to check the process and sends email if the process is not running.If it is running it will continue and do some other operation. I didnot understand below option -z in the if condition.I have tried to... (5 Replies)
Discussion started by: muraliinfy04
5 Replies

10. UNIX for Beginners Questions & Answers

Check status of process

Hi All, Have a query How to check for a process and if down start it , try if for 2 times and its not starting don't do it My code is working to some extent but while starting try starting both times. Please advise , whats wrong here ? if you have any other approach please do share. My... (1 Reply)
Discussion started by: abhaydas
1 Replies
ruptime(1)						      General Commands Manual							ruptime(1)

NAME
ruptime - show status of local machines SYNOPSIS
DESCRIPTION
outputs a status line for each machine on the local network that is running the daemon. status lines are formed from packets broadcast once every 3 minutes between daemons (see rwhod(1M)) on each host on the network. Each status line has a field for the name of the machine, the status of the machine (up or down), how long the machine has been up or down, the number of users logged into the machine, and the 1-, 5- and 15-minute load averages for the machine when the packet was sent. The status of the machine is reported as ``up'' unless no report has been received from the machine for 11 minutes or more. The length of time that the machine has been up is shown as: Load averages are the average number of jobs in the run queue over the last 1-, 5- and 15-minute intervals when the packet was sent. An example status line output by might be: The above status line would be interpreted as follows: is presently ``up'' and has been up for 1 day, 5 hours and 15 minutes. It currently has 7 users logged in. Over the last 1-minute inter- val, an average of 1.47 jobs were in the run queue. Over the last 5-minute interval, an average of 1.16 jobs were in the run queue. Over the last 15-minute interval, an average of 0.80 jobs were in the run queue. If a user has not used the system for an hour or more, the user is considered idle. Idle users are not shown unless the option is speci- fied. Options If no options are specified, the listing is sorted by host name. Options change sorting order as follows: Sort by load average. Sort by up time. Sort by the number of users. Reverse the sort order. DIAGNOSTICS
No status report files in Ask the system administrator to check whether the daemon is running. AUTHOR
was developed by the University of California, Berkeley. FILES
Data files SEE ALSO
rwho(1), rwhod(1M). ruptime(1)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy