[Solved] How to Check if a script is running?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] How to Check if a script is running?
# 1  
Old 11-22-2012
[Solved] How to Check if a script is running?

Hi All,

I am new to Unix...

Can you please let me know how we can check if a script is running or not on Solaris box?
# 2  
Old 11-22-2012
Use ps - report process status
Code:
ps -eaf | grep script | grep -v grep

# 3  
Old 11-22-2012
Quote:
Originally Posted by bipinajith
Use - report process status
Code:
ps -eaf | grep script | grep -v grep

I have ran the above command....
No output is coming...Is that means the particular script is not running?
# 4  
Old 11-22-2012
If you have ran this command by replacing script with your script name, then yes your script is not running.
Code:
ps -eaf | grep script | grep -v grep

This User Gave Thanks to Yoda For This Post:
# 5  
Old 11-22-2012
Quote:
Originally Posted by bipinajith
If you have ran this command by replacing script with your script name, then yes your script is not running.
Code:
ps -eaf | grep script | grep -v grep


Thanks for your prompt response....
yes i have replaced script with my script name.
My query is resolved ...thanks again

Last edited by Rahul466; 11-22-2012 at 12:47 PM.. Reason: .
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

[Solved] Running a R script with in a shell script

Hi, I do have an R script named KO.R. Basically reads thousands of files, whose name has a pattern that differs at a portion of the file name, List.txt. Row_file1_mile.txt Row_file2_mile.txt Row_file3_mile.txt ... ... Row_file1000_mile.txt Below is a portion of my Rscript that reads... (4 Replies)
Discussion started by: Kanja
4 Replies

3. 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

4. Shell Programming and Scripting

[Solved] The SCRIPT command - Can we see the log file of a running session?

Hello. This is my situation. script .anything ls -l . ---How can I see the content of .anything using (i.e) cat .anything? If not possible can someone suggest a sequence to simulate a console-recorder to "observ" from a RUNNING script session? Thanks Paolo Please use code tags... (3 Replies)
Discussion started by: paolfili
3 Replies

5. Shell Programming and Scripting

[Solved] Looking for script running before I run script again

Good afternoon! I have a script in cron that runs every ten minutes. Normally it only takes a minute or so to complete. However there are times when the amount of data it is looking at is large, and it has taken 20 minutes. So I want for it to look for the script before it starts. I was... (8 Replies)
Discussion started by: brianjb
8 Replies

6. Shell Programming and Scripting

[Solved] Help with running ps -e | less on nano script editor

p { margin-bottom: 0.08in; } This is just a portion of a script I'm writing on Linux nano script editor. When I run the script I get stuck on the ps -e | less command portion of the script:wall:. It displays all the process running but it does not allow me to move to the next line on the script.... (2 Replies)
Discussion started by: SANA4SPA
2 Replies

7. 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

8. 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

9. Shell Programming and Scripting

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

10. 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
Login or Register to Ask a Question