01-30-2017
Thanks Scrutinizer..
But sometimes few persons are giving CTRL + Z to run it in background and they are forgetting to let it run in bg. At that time if another person run the same script again means i am not getting the desired output from the script as both the script execution will write in same output file.
So by considering this and bcoz of some other reason, i decided to place the file on server local filesystem and can be run from that server only. i know grep is not suitable one here as if i use 'ps|grep report.sh' command it ll fetch other occurrences as well (i.e less report.sh, vi report.sh, etc). In this case can i use any other ways to check if the script is already running.
Last edited by thomasraj87; 01-30-2017 at 05:06 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
6. UNIX for Dummies Questions & Answers
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
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
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? (4 Replies)
Discussion started by: Rahul466
4 Replies
9. Linux
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
10. Shell Programming and Scripting
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
LEARN ABOUT PHP
set_time_limit
SET_TIME_LIMIT(3) 1 SET_TIME_LIMIT(3)
set_time_limit - Limits the maximum execution time
SYNOPSIS
bool set_time_limit (int $seconds)
DESCRIPTION
Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 sec-
onds or, if it exists, the max_execution_time value defined in the php.ini.
When called, set_time_limit(3) restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25
seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.
PARAMETERS
o $seconds
- The maximum execution time, in seconds. If set to zero, no time limit is imposed.
RETURN VALUES
Returns TRUE on success, or FALSE on failure.
NOTES
Warning
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing
the time limit in the php.ini.
Note
The set_time_limit(3) function and the configuration directive max_execution_time only affect the execution time of the script
itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(3), stream
operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not
true on Windows where the measured time is real.
SEE ALSO
max_execution_time, max_input_time.
PHP Documentation Group SET_TIME_LIMIT(3)