Sponsored Content
Top Forums Shell Programming and Scripting How to check the status of script for every 5 min? Post 302863687 by gnnsprapa on Tuesday 15th of October 2013 03:30:19 AM
Old 10-15-2013
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
Code:
nohup opt/app/dev/scripts/load_cdr.sh A > opt/app/dev/logs &
nohup opt/app/dev/scripts/load_cdr.sh B > opt/app/dev/logs &

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.

TIA
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to check exit status in awk script

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)
Discussion started by: epall
1 Replies

2. Shell Programming and Scripting

Script to check status of a PID

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)
Discussion started by: zeekblack
14 Replies

3. Shell Programming and Scripting

check exit status - Expect Script

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)
Discussion started by: iamcool
1 Replies

4. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

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)
Discussion started by: bpm12
1 Replies

5. UNIX for Dummies Questions & Answers

SFTP script - poll every min to check file complete before transfering

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)
Discussion started by: srineel
4 Replies

6. Shell Programming and Scripting

Automation, Copy, File Status Check --> Script(s)

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)
Discussion started by: karthi_mrkg
3 Replies

7. Shell Programming and Scripting

Help....script check status if see something then send email

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)
Discussion started by: dotran
6 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

UNIX script to check multiple jobs runninng status

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)
Discussion started by: nandu67
1 Replies

10. Shell Programming and Scripting

Script to check process status

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)
Discussion started by: muraliinfy04
5 Replies
script(5)							       Files								 script(5)

NAME
script - Boot script DESCRIPTION
The boot script describes how the Erlang runtime system is started. It contains instructions on which code to load and which processes and applications to start. The command erl -boot Name starts the system with a boot file called Name.boot , which is generated from the Name.script file, using sys- tools:script2boot/1 . The .script file is generated by systools from a .rel file and .app files. FILE SYNTAX
The boot script is stored in a file with the extension .script The file has the following syntax: {script, {Name, Vsn}, [ {progress, loading}, {preLoaded, [Mod1, Mod2, ...]}, {path, [Dir1,"$ROOT/Dir",...]}. {primLoad, [Mod1, Mod2, ...]}, ... {kernel_load_completed}, {progress, loaded}, {kernelProcess, Name, {Mod, Func, Args}}, ... {apply, {Mod, Func, Args}}, ... {progress, started}]}. * Name = string() defines the name of the system. * Vsn = string() defines the version of the system. * {progress, Term} sets the "progress" of the initialization program. The function init:get_status() returns the current value of the progress, which is {InternalStatus,Term} . * {path, [Dir]} where Dir is a string. This argument sets the load path of the system to [Dir] . The load path used to load modules is obtained from the initial load path, which is given in the script file, together with any path flags which were supplied in the command line arguments. The command line arguments modify the path as follows: * -pa Dir1 Dir2 ... DirN adds the directories Dir1, Dir2, ..., DirN to the front of the initial load path. * -pz Dir1 Dir2 ... DirN adds the directories Dir1, Dir2, ..., DirN to the end of the initial load path. * -path Dir1 Dir2 ... DirN defines a set of directories Dir1, Dir2, ..., DirN which replaces the search path given in the script file. Directory names in the path are interpreted as follows: * Directory names starting with / are assumed to be absolute path names. * Directory names not starting with / are assumed to be relative the current working directory. * The special $ROOT variable can only be used in the script, not as a command line argument. The given directory is relative the Erlang installation directory. * {primLoad, [Mod]} loads the modules [Mod] from the directories specified in Path . The script interpreter fetches the appropriate mod- ule by calling the function erl_prim_loader:get_file(Mod) . A fatal error which terminates the system will occur if the module cannot be located. * {kernel_load_completed} indicates that all modules which must be loaded before any processes are started are loaded. In interactive mode, all {primLoad,[Mod]} commands interpreted after this command are ignored, and these modules are loaded on demand. In embedded mode, kernel_load_completed is ignored, and all modules are loaded during system start. * {kernelProcess, Name, {Mod, Func, Args}} starts a "kernel process". The kernel process Name is started by evaluating apply(Mod, Func, Args) which is expected to return {ok, Pid} or ignore . The init process monitors the behaviour of Pid and terminates the system if Pid dies. Kernel processes are key components of the runtime system. Users do not normally add new kernel processes. * {apply, {Mod, Func, Args}} . The init process simply evaluates apply(Mod, Func, Args) . The system terminates if this results in an error. The boot procedure hangs if this function never returns. Note: In the interactive system the code loader provides demand driven code loading, but in the embedded system the code loader loads all the code immediately. The same version of code is used in both cases. The code server calls init:get_argument(mode) to find out if it should run in demand mode, or non-demand driven mode. SEE ALSO
systools(3erl) Ericsson AB sasl 2.1.9.3 script(5)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy