Sponsored Content
Top Forums Shell Programming and Scripting ksh script to check if certain process is running Post 302929837 by RudiC on Saturday 27th of December 2014 07:56:54 AM
Old 12-27-2014
Your loop will never finish as TESTSTATUS will not change its state as it's not reassigned.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to check for a particular process and alert if its not running

Hai Friends, I have to develop a script that checks for a particular process say x.exe once every day and report if its not running say through a blat mail. I need this to run in a given list of pc from a single point. Any suggestion of how to go abt this Thnx for any help (1 Reply)
Discussion started by: goks
1 Replies

2. UNIX for Advanced & Expert Users

how to check if a process is running in a server from shell script.

I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process??? (2 Replies)
Discussion started by: debu
2 Replies

3. Shell Programming and Scripting

script to check if process is running

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)
Discussion started by: daydreamer
2 Replies

4. Shell Programming and Scripting

How to write an expect script to check if a process is running?

I'm new to expecting and i want to create a script to ssh to a device,check is a process is running and display that the process is running or not.This is what i have so far After executing this script i get an error. #!/usr/bin/expect set timeout -1 set ip "machine ip goes here" set... (5 Replies)
Discussion started by: icchi
5 Replies

5. UNIX and Linux Applications

How to check if process is running?

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)
Discussion started by: ladyAnne
5 Replies

6. Shell Programming and Scripting

Script to check running of process

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)
Discussion started by: lovepujain
2 Replies

7. Shell Programming and Scripting

Simple Script to Check running Process

#!/bin/sh CHECK='ps aux | grep start.jar | grep -v grep | wc -l' if then /usr/local/jre-1.7.0/bin/java - jar start.jar & else fi Could anybody advise whats up with this code im trying to put this in as a cron job to check that solr search engine is running every 10secs and if... (10 Replies)
Discussion started by: will_123
10 Replies

8. Shell Programming and Scripting

Script in KSH to check if a process its up or down.

Hi all! Im working on a simple script in KSH (just started) to check if a process its up or down, but im kind of lost with the following error. Script: #!/usr/bin/ksh psup=$(ps -ef | grep sftp | egrep -v grep | wc -l) if ($psup > 0); then echo "Process SFTP running" else ... (6 Replies)
Discussion started by: ARSport
6 Replies

9. UNIX for Dummies Questions & Answers

How a process can check if a particular process is running on different machine?

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)
Discussion started by: saurabhnsit2001
2 Replies

10. Shell Programming and Scripting

How to add conditional check of whether a process is running before doing rest of script?

Hi, I'm looking at doing a cron job for a script that could take a very short time to complete or a very long time to complete based on variable activity on a server. I don't want to do a weird schedule, but I don't want to be so aggressive that the process attempts to start before another... (14 Replies)
Discussion started by: nbsparks
14 Replies
PMTIME(3)						     Library Functions Manual							 PMTIME(3)

NAME
pmtime, pmTimeConnect, pmTimeDisconnect, pmTimeRecv, pmTimeSendAck, pmTimeShowDialog - time control functions for synchronizing the archive position and update interval between one or more applications C SYNOPSIS
#include <pcp/pmtime.h> int pmTimeConnect(int port, pmTime *state); int pmTimeDisconnect(int fd); int pmTimeSendAck(int fd, struct timeval *fetchTime); int pmTimeShowDialog(int fd, int show); int pmTimeRecv(int fd, pmTime *state); cc ... -lpcp_gui DESCRIPTION
These functions form part of the Performance Metrics Applications Programming Interface (PMAPI) and are intended to provide a uniform mech- anism for applications to both replay archive data and report live data in a time synchronized manner. The pmTime structure has the following fields: typedef struct { unsigned int magic; unsigned int length; pm_tctl_command command; pm_tctl_source source; pm_tctl_state state; pm_tctl_mode mode; struct timeval delta; struct timeval position; struct timeval start; /* archive only */ struct timeval end; /* archive only */ char data[0]; /* arbitrary length info (TZ) */ } pmTime; In the simplest case, the application should call pmTimeConnect to connect to the time control server, pmtime(1), and then repeatedly call pmTimeRecv in the main loop of the application. On success, pmTimeConnect returns a non-negative file descriptor. In applications which have multiple threads of control, rather than simply blocking in pmTimeRecv, the file descriptor may be used in calls to select(2). In graphical applications, the file descriptor may be used to interface with the event loop. The port parameter to pmTimeConnect is the port number of the socket on which the time control server is (or will be) listening for new connections. The state parameter to pmTimeConnect is used to initialize a new time control server or to pass additional information to an existing time control server. The start and finish fields indicate the chronological bounds interesting to the application. The showdialog field indi- cates whether the time control server should initially show or hide the dialog. The position, delta, and data fields indicate the initial archive position, update interval, time zone string and time zone label string. pmTimeRecv blocks until the time control server sends a command message. It then updates the state parameter and returns one of the PM_TCTL command identifiers. The PM_TCTL_SET command indicates the application should seek to the archive position (see pmSetMode(3)) returned in the position field of the state parameter. The PM_TCTL_STEP command indicates the application should perform an update, i.e. advance (or rewind, if delta is negative) to the time indicated by position and then fetch new metric values, update the display or whatever. In order for several application to remain syn- chronized, the time control server will wait until all applications have acknowledged that they have completed the step command. Applica- tions should call pmTimeSendAck when the step command has been processed. Note that PM_TCTL_STEP is the only command that requires an explicit acknowledgement. The PM_TCTL_VCRMODE command is used by the time control server to indicate the current VCR mode. The value is returned in the vcrmode field of the state parameter passed to pmTimeRecv, and remains valid until the next PM_TCTL_VCRMODE command is received. The PM_TCTL_TZ command indicates the application should use a new time- zone, as indicated in the tz and tzlabel fields of the state param- eter. The PM_TCTL_BOUNDS command is sent to all applications when the time control server changes its chronological bounds. This may occur when a new application connects to the time control server or the user changes the bounds manually. Most applications will ignore this command. The PM_TCTL_SHOWDIALOG command will be sent to all applications when the visibility of the time control server changes. This allows appli- cations to alter the text in menus or buttons to reflect this change. Applications may change the visibility of the time control dialog using the pmTimeShowDialog function. The initial visibility is determined when the time control dialog is first created by an application calling pmTimeConnect with the showdialog field in the state parameter set to the desired value. The pmTimeDisconnect function may be used to close the command socket to the time control server. This is useful when applications need to change the connection mode, e.g. to divorce the current time control server and connect to a new one. SEE ALSO
pmtime(1), PMAPI(3) and pmSetMode(3). Performance Co-Pilot Aconex PMTIME(3)
All times are GMT -4. The time now is 12:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy