Sponsored Content
Top Forums Shell Programming and Scripting script to check if another script is running and if so, then sleep for sometime and check again Post 302439084 by mathews on Wednesday 21st of July 2010 06:02:29 PM
Old 07-21-2010
script to check if another script is running and if so, then sleep for sometime and check again

Hi,
I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop.
I am using RHEL 5.2
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check that script is not running twice

using ps -ef | fgrep "ld_data" how do i write a script to check that it didn't already run Thanks (2 Replies)
Discussion started by: Link_02
2 Replies

2. Shell Programming and Scripting

Check if trigger Script is running

HI, I have a script which will be running all the time...it is like a trigger.. wakesup every 10 minutes(trigger.sh) executes, and I want to write another script which monitors this script every one hour and if it finds that trigger script is not running it should start it and exit...and here... (9 Replies)
Discussion started by: mgirinath
9 Replies

3. Shell Programming and Scripting

Running a check platform script

Hi, I want to run a check platform & application script under ksh (Soaris boxes). It runs some commands and it take some time. I want to customize it like that: - output is too big, hence I want some output of the commands to be redirect ed in an output file (or maybe two or three) - not... (4 Replies)
Discussion started by: heartwork
4 Replies

4. UNIX for Dummies Questions & Answers

check user id before running script

I am looking for the syntax to check which ID is executing script.sh. If the the ID, is not user1 then I want the script to exit and return to command prompt, if it is user1, then I want the script to continue. Any help would be greatly appreciate. Thank you. Chris (3 Replies)
Discussion started by: cpolikowsky
3 Replies

5. Shell Programming and Scripting

script to check for existence of file (or else sleep for x time)

Hi Forum. I have a script that accepts 3 input parameters (source directory, list file text, sleep time) and checks for the presence of files. If not there, script goes to sleep for certain amount of time provided by 3rd input. list file text contains 1 entry but may contain more (file... (13 Replies)
Discussion started by: pchang
13 Replies

6. UNIX for Dummies Questions & Answers

Help Running a Check in Bash Script

Hey guys, so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g. unknown-hacker|544> count.sh 1 3 1 2 3 My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2... (2 Replies)
Discussion started by: Duo11
2 Replies

7. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

8. Linux

Check up the status of a Script (running or not)

Hello, i allready search on google und here in the local Forum, but can't found something. I need a query in php, that check whether a process (script) is running or not. Like this: php query: /usr/bin/Script01 >> if runnig, then: "Script01 is Online", if not "Script01 is Offline" I... (2 Replies)
Discussion started by: ProTechEx
2 Replies

9. Shell Programming and Scripting

Check to see if script is already running

Happy New Year Is there a quick way to check to see if a script is already running. I want to put in a check in the script to exit, if already running. Currerntly i can only think of doing it the following way. # ps -ef | grep -i 3_HOUSEKEEPING_FFTVTL_TO_FFTDSSU_DUPLICATION.ksh |... (5 Replies)
Discussion started by: Junes
5 Replies

10. UNIX for Beginners Questions & Answers

How to check if the script is already running?

I have one shell script in NAS shared location. Since NAS is mounted in many servers, script can be run from any of those servers. I want to make sure if the script is already running, it should not allow others to run it. I googled it and got some idea that i can touch one empty file in the... (8 Replies)
Discussion started by: thomasraj87
8 Replies
socklog-check(8)					      System Manager's Manual						  socklog-check(8)

NAME
socklog-check - checks for the availability of a socklog(8) service. SYNOPSIS
socklog-check [-v] [unix [address]] DESCRIPTION
socklog-check attempts to connect to a socklog(8) unix service and reports whether the connection attempt succeeded or not. It connects to the datagram oriented unix domain socket address, and reports success through the return code. If address is not specified, socklog-check attempts to connect to /dev/log. When running services that use the syslog facility under runit's service supervision, socklog-check should be added to the top of the ser- vice's run script to ensure that no syslog messages are generated until a syslog service is up and running to process the messages, e.g.: #!/bin/sh socklog-check || exit 1 exec service_using_syslog OPTIONS
-v verbose. Print verbose message to standard error. EXIT CODES
On success socklog-check returns 0. On error, socklog-check prints a message to standard error and exits 111. SEE ALSO
socklog(8), socklog-conf(8), svlogd(8), tryto(1), uncat(1), sv(8), runsv(8), runsvdir(8) http://smarden.org/socklog/ http://smarden.org/runit/ AUTHOR
Gerrit Pape <pape@smarden.org> socklog-check(8)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy