Need help to identify the flags by scripts.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help to identify the flags by scripts.
# 1  
Old 06-02-2009
Need help to identify the flags by scripts.

Hi,

I have two different scripts sap_ftp.sh and sap_ftp_dd.sh which are running continously in background. I am using another script called start.sh to launch these two scripts.

Either one script will process files at a time . During that time other script will sleep.. Each script will create corresponding flag file while processing files

sap_ftp.sh script checks weather sap_ftp_dd.sh flag exists or not. If flag exists this script will go to sleep for 10 secs. After that again it wakes up and checks flag exists or not, If it does not sap_ftp.sh starts processing the files by creating the flag file.

This is same for sap_ftp_dd.sh . This scritp also checks is there any (sap_ftp.sh) flag exists. If this does not exists, it will start processing files or else goes to sleep for 10 secs..

I am facing a problem while identifying the flags...

Since i am launching both the scripts through different script. Both are getting launch at a time.. Both are checking for the flags. Both are not finding any thing. Both are inserting the flags at a time and both are deleting the flags at a time.

I tried launching the second script delayed by few seconds. but that also did not worked out..

kindly help me how can i able to make scripts to identify the flag.

Thanks
# 2  
Old 06-02-2009
From what you describe it looks like you have a race condition.

However without showing us the two scripts there is not much anybody can do to really help you figure out what is going on.

One suggestion, both your sleeps are set to 10 seconds. Change the first to 11 seconds and the second to 7 seconds.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Identify tables from Oracle sql scripts

Hi, Please let me know if you have any thoughts on how to read a table that has all the oracle sql files or shell scripts at the job and step level to identify all the tables that does merge, update, delete, insert, create, truncate, alter table (ALTER TABLE XYZ RENAME TO ABC) and call them out... (1 Reply)
Discussion started by: techmoris
1 Replies

2. Shell Programming and Scripting

How to identify heredocs in shell scripts?

tr a-z A-Z << END_TEXT one two three four five six END_TEXT i dont want this to be executed when someone runs the script that this is in. but for some reason, it gets executed. anywhere i can wrap this up in something to make sure it never gets executed? another example: cat <<... (1 Reply)
Discussion started by: SkySmart
1 Replies

3. Shell Programming and Scripting

flags to avoid restart

hello all, i have the below script that we used to backup our DB using oracle's utility called RMAN. This has been working fine, but the issue is when the backup fails and we re-start it, it backups the whole thing again. Example. lets say i have 5 database on my system(db1,db2,db3,db4,db5)... (11 Replies)
Discussion started by: crazy_max
11 Replies

4. UNIX for Dummies Questions & Answers

Ifconfig Flags

Hi there, I need your help in understanding the below Solaris 10 ifconfig output; athnetspns02>ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0:... (2 Replies)
Discussion started by: wthomas
2 Replies

5. UNIX for Advanced & Expert Users

How to identify the scripts ran at a particular day of last month?

How to identify the scripts ran at a particular day of last month? I have to identify a script that ran on 06/01/2011 @ 4 am (3 Replies)
Discussion started by: rdhanek
3 Replies

6. UNIX for Dummies Questions & Answers

WHat are flags?

Can anybody actually tell, what is flag? I know they are termed as permission flags and various others. Please explain (3 Replies)
Discussion started by: nixhead
3 Replies

7. UNIX for Dummies Questions & Answers

XLF90 Flags to PGF90

Hello, I am running into a bit of an issue running a Makefile. The problem is it was written for a xlf90 compiler when I have a pgf90 on the machine. Therefore, I keep getting errors regarding the xlf90 flags because they don't correspond with the pgf90. Here is the code: ... (0 Replies)
Discussion started by: lepagano
0 Replies

8. UNIX for Dummies Questions & Answers

Question about Setting Flags

I have a script which will look for a test folder under the parent directory. If the folder contains test folder then create the same directory structure in other remote machine. Once the directories are created then transfer all the contents of that test folder. this is what i am doing :- ... (2 Replies)
Discussion started by: chris1234
2 Replies

9. Shell Programming and Scripting

makefile not taking -D flags

Hi, I found this strange behaviour while using one of the makefiles. Here is the snippet of the unix.mak that is necessary for this context SO = SvSocket.o SvStmt.o SvOdbcWrapper.o \ OdbcCallReader.o MgrCalls.o OdbcSvProxy.o \ OdbcSvApp.o... (4 Replies)
Discussion started by: vino
4 Replies

10. UNIX for Dummies Questions & Answers

if flags

Hi folks. I'm just starting to teach myself shell scripting and am having some trouble with an if statement. I am working with a directory where only one file will reside at a time and need to evaluate if this file is compressed to determine subsequent steps. I'm using echo for testing purposes.... (2 Replies)
Discussion started by: kristy
2 Replies
Login or Register to Ask a Question