How to check the status of script for every 5 min?
Hi,
Can any1 provide the code for my req:
I am loading few set of files into database through one unix script. I ll try to describe the process:
load_cdr-->main script
Source Feeds are A & B.
File in A-akm.dat
File in B-bkm.dat
Now my script runs through cron jobs everyday...and for both A&B it runs parllely...i.e script will start loading data from akm also and bkm also...prob is these two files try to update same table at some point and gives an error.
for eg: i use one script named as daily.sh which consist of commands which start my script
I cannot go with an option where i run my script sequentially for each source Feeds. So need smthing like sleep command usage ..
**when ever any feed's file start loading it creates some lock file..
eg: if akm.dat dile of source feed A is getting loaded in temp dir A.lck file gets created and similarly for B feed also..
Now i want that my script should check if A.lck file exist in that folder and if it is present and B feed try to load then script loading B feed should go into sleep mode and check in every 5 min if A.lck file got removed or not..once it got removed B file starts loading
It might be bit confusing ..so please let me knw if i missed ny pt.
well i also came up with this idea but can u tell me how to check for the lock file existence and if exists then execute sleep command..something like
if [-f a.lck] then
check if opt/app/dev/scripts/load_cdr.sh B > opt/app/dev/logs is active and if both cond true then
suspend the opt/app/dev/scripts/load_cdr.sh B > opt/app/dev/logs till lck file gets removed..my guess is we have to provide some while loop with sleep command...
As it is the file same called, but with a diffrent argument, it depends if also the first argument should be forced to 'sleep' until the lockfile is gone...
In that case it could look simliar:
Hope this helps
Your flag may unexpectedly remains in case your script is killed while running in the critical section.
To avoid this you should set a trap.
I suggest you read the following article which gives clues about some common implementation weakness while scripting (check especially the sections relating to flag/lock files)
Hi Team,
I am using redhat 6.4 version server.We have a script which is used to check the process and sends email if the process is not running.If it is running it will continue and do some other operation.
I didnot understand below option -z in the if condition.I have tried to... (5 Replies)
Hi Folks,
Please help me ,I need a unix shell script to check for multiple jobs running. if there are multiple backup Jobs running then it should be trigger an email .
Thanks,
Anand T (1 Reply)
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)
autorep -m bogus
Machine Name Max Load Current Load Factor O/S Status
___________ ________ ___________ ______ ________ ______
bogus --- --- 1.00 Sys Agent Online
Status
______
Online
Offline
Missing
Unqualified
The "Status" always "Online". I like create a script execute run... (6 Replies)
All,
I have to write a script to do the following requirement.
There is a file called BUSINESS_DATE.TXT.
This file get updated once the oracle partition created. In Oracle, Partition will be created every day. There is a seperate script scheduled to take care ORACLE partition creation.
The... (3 Replies)
Hello,
Before I do a GET remote file, I need to ensure the remote file is a complete file i.e. whatever process is saving the file to the remote folder should complete the transfer before I go GET it through my script.
So I'm thinking I need to poll the remote file every minute or so to... (4 Replies)
rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh`
if $rshstatus <>0 then
errstatus=1
mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr
else if errstatus=0
echo "status to xirsol8dr successful"
can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
from my main script, i am calling an expect script. there are a lot of conditions in the Expect script and it can have any exit value based on success or failure of the Expect Script. how can i check the exit status of Expect scritp in the main script. (1 Reply)
i'm just learning scripting, and have been banging my head against this
I want to check if my WAS6 java process is running and if so..echo me a messages. If not then echo me a different messages
the problem i have is I dont know how to represent a NULL return value. If i grep for a was6... (14 Replies)
Hi,
I have a main program which have below lines
-
awk -f test.awk inputFileName
-
I wonder how to check status return from awk script.
content of awk script:
test.awk
---
if ( pass validation )
{
exit 1
}
else
{ (1 Reply)