Sponsored Content
Full Discussion: adding delay in script
Top Forums Shell Programming and Scripting adding delay in script Post 302205353 by matrixmadhan on Saturday 14th of June 2008 01:30:20 PM
Old 06-14-2008
Quote:
Hi Expert,
not me Smilie

Code:
I need to run some command 5 times with 5 mins interval whenever one of the application on server hang.

When some application hangs without processing - how do you define the state of being 'hung' for an application ? is it not responding any queries or requests ?

You could use a while loop to achieve the same ( search the forum for while loop example )
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Insert a delay in a script

Hi all, i need help. I want to write a script and insert a delay time of 10 seconds. Which is the command for do this? Thanks in advance (1 Reply)
Discussion started by: christian
1 Replies

2. UNIX for Dummies Questions & Answers

Delay in mv

Working on AIX 4.3 I have an active exe that accepts files for processing on our RS6000. Day to day i store these files in a secure place and at the end of the day I mv them one by one. After some reading and ofcourse trial and error i figured out that this helps... mv `ls -l |head -l | awk... (2 Replies)
Discussion started by: buRst
2 Replies

3. Programming

Delay a process.

How to delay a process. I need to to delay a process from 3sec. At that 3sec other back ground processes also should stop. (just sit 3sec for idle & then starts execution as normally) I use sleep(3)-But it not stop the bg processes I try to use loop but it not gurantee to wait 3sec. ... (2 Replies)
Discussion started by: ugp
2 Replies

4. Shell Programming and Scripting

how to introduce delay in the script??(urgent)

Hi all, i would like to know how to introduce a delay in the execution of a cmd? am trying to copy a file which is about 650 mb and then perform some actions on it.. however since its huge i would like to introduce a delay in exection until the process is over i dont want it to proceed to... (10 Replies)
Discussion started by: wrapster
10 Replies

5. Shell Programming and Scripting

Want to have delay in multiple instances of the same shell script

Hello, My goal is to run the same Shell script in a parallel mode. This script will get triggered from different machines and different application teams by some job scheduling tool. They may trigger the process at the same time. so I want to have them in QUEUE ..and release them for execution on... (3 Replies)
Discussion started by: chetan_sonar
3 Replies

6. Shell Programming and Scripting

How to introduce delay in Shell Script till a key stroke.

Hi All, How to introduce delay in the Bash/Shell Script till key stroke. Below is the requirement.. 1.Execute set of commands. 2.Display the message echo "press any key to continue" Introduce a delay till key stroke. 3.Execute next set of commands. Thanks in Advance Sunil.K (5 Replies)
Discussion started by: sunilrk07
5 Replies

7. Shell Programming and Scripting

How do I do a short delay (milliseconds) in a shell script?

I need to put a small delay into a shell script. I'm looking for something smaller than "sleep" - a second is way too long. I want to sleep something like 10 milliseconds. I've tried "usleep" and "nanosleep", but the script doesn't recognize them. I'm using the bash shell but I'm willing to... (9 Replies)
Discussion started by: harmlesscat
9 Replies

8. Shell Programming and Scripting

Delay in running script from crontab

I am facing an issue where sometimes crontab is running script with some delay. Below is the stmt in script and it is the only stmt in script. echo "running at `date` " >> CRONCHECK.log Below is the cron entry. 0 11 * * * CRONCHECK.sh Below is the time of run each day. running at Fri... (8 Replies)
Discussion started by: Nishant Singh
8 Replies

9. Shell Programming and Scripting

Adding script

I have a script that will run a lint check on all shell and perl scripts that I have in 2 different branches and will report back in a tmp.log file that will show me what works and doesn't. I am trying to add to it, so that not only will it bring back the log file or errors, but also to improve... (2 Replies)
Discussion started by: bigbenn
2 Replies

10. Shell Programming and Scripting

Loop without a delay

Hi, I am trying to understand what would happen if ther is a loop without any delay like sleep statement, I feel that would add a lot of load onto the CPU. Trying to understand how the load is reduced by the introduction of sleep(). Thanks and regards Zulfi (3 Replies)
Discussion started by: zulfi123786
3 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 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy