Multiple access to a script at same time- problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Multiple access to a script at same time- problem
# 1  
Old 09-14-2010
Multiple access to a script at same time- problem

Dear frnds,


I have developed a shell script.


Like , the script will produce a output file with 4-5 lines using the parameters passed to it.
Around 25 jobs would be calling the script at the same time. For few jobs alone, the output file is not created properly.








The script get 6 paramaters and I am storing them in 6 variables and printing them into a outfile with uniq name for each job.


The wrong output file


Input1=aaaa
Input2=bbbb
Input3=cccc
Input4=<empty> (it should have “dddd”)
Input5=<empty> (“eeee”)
Input6=<empty> (“ffff”)






Any help dude? Why its happens like this ?
# 2  
Old 09-14-2010
show us the script.

We can't guess it.
# 3  
Old 09-14-2010
The script would be executed in this way. like this many job will call the script with differnt parameters.

sh test.sh RTO_FAST RED_FEST 23 CUSTOMER SOCKET_SESSION s_RTO_WND_SOCKET_FINDER

Code:
var1=$1
var2=$2
var3=$3
var4=$4
IN_SESSION_NAME=$5
var6=$6



create_parmeter_file()
{

echo " Preparing the parameter file "                    
PID=${$}
PARAMETER_FILE=usr1/WDN/pmf/SOA/${IN_SESSION_NAME}.param
rm -rf ${PARAMETER_FILE}


echo "[${var1}]" > ${PARAMETER_FILE}
echo "[${var2}]" >> ${PARAMETER_FILE}
echo "[${var3}]" >> ${PARAMETER_FILE}
echo "[${var4}]" >> ${PARAMETER_FILE}
echo "[${IN_SESSION_NAME}]" >> ${PARAMETER_FILE}


IN_SOURCE_TABLE=`echo ${var6} | sed 's/s_RTO_ROASTER_//' | sed 's/s_RTO_WND_//' | sed 's/s_RTO_PPG/PPG_/'`   

echo "[${IN_SOURCE_TABLE}]" >> ${PARAMETER_FILE}
   

chmod 777 ${PARAMETER_FILE}


}

create_parmeter_file

exit 0

Moderator's Comments:
Mod Comment Please use [code], not <code>

Last edited by pludi; 09-14-2010 at 08:48 AM..
# 4  
Old 09-14-2010
I run the script in my env without issue, and get the param file:

Code:
cat SOCKET_SESSION.param
[RTO_FAST]
[RED_FEST]
[23]
[CUSTOMER]
[SOCKET_SESSION]
[SOCKET_FINDER]

And don't forget to use code tags.

[CODE] not <code>
# 5  
Old 09-14-2010
when 25 jobs calling this script at the same time with it own paramters, for few of the job output is not the expected one.

like, it comes as below , it happenss only for 2 or 3 jobs out of 25

[RTO_FAST]
[RED_FEST]
[23]
<empty> [ie., just a blank line]
<empty>
<empty>
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to access multiple file and operate on single file

We have three files as mentioned below: 1. main_file.txt: This is the file in which all operations will be done. Which means this file will be signed by using the below two files 2. signature_file.txt: This is a status file and contains two signatures. 3. command.txt:file contains two commands... (2 Replies)
Discussion started by: chetanojha
2 Replies

2. Shell Programming and Scripting

Sftp script to get multiple files at the same time

i have to log into an sftp server to get multiple files. im typing this post from a remote location and i dont have the script i wrote with me. but i got the sftp script to work by logging into the sftp server file by file. meaning, sftp to the server, "mget -p" or "get -p" one file at a time.... (4 Replies)
Discussion started by: SkySmart
4 Replies

3. Shell Programming and Scripting

awk script to find time difference between HTTP PUT and HTTP DELETE requests in access.log

Hi, I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log. Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies

4. Shell Programming and Scripting

Shell Script to delete files within a particular time frame under multiple sub folders

Greetings! I'm looking for starting information for a shell script. Here's my scenario: I have multiple folders(100) for example: /www/test/applications/app1/logs /www/test/applications/app2/logs Within these folders there are log files files that need to be deleted after a month. ... (3 Replies)
Discussion started by: whysolucky
3 Replies

5. Shell Programming and Scripting

Korn script to access multiple host and collect data

Hi, I'm newbie in Korn scripting as well as in Unix. I need to have a script to do the following. 1) ssh multiple hosts -In my case, login credentials are not an issue as all keys authorized by default. Example of host IP (24.35.14.6, 24.35.14.7, 24.35.14.8, 24.35.14.9, ... (2 Replies)
Discussion started by: blinkingdan
2 Replies

6. UNIX for Advanced & Expert Users

Script to access multiple linux servers to get system details such as CPU usage

Hi Is there any shell script that accesses multiple linux servers to get details such as CPU usage, RAM used etc. The access of the servers must be parallel not serial in the sense it must ping all the servers at a time to get information.The script has to be triggered from a host system and get... (7 Replies)
Discussion started by: mssrivatsa
7 Replies

7. Programming

Date time problem while executing perl script.

Hi All, This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
Discussion started by: ravimishra
0 Replies

8. UNIX for Dummies Questions & Answers

kernel giving access for multiple users to access files

hi all, i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies

9. Shell Programming and Scripting

login into multiple servers through script is having some problem

Hi Everybody, I am bit new to shell scripting. I need some help in my script. I have to login into 15 servers and check some logs daily. For that I've written one shell script, somewhere it is having some problems. After log into the first server, the script is not going with the next steps.... (6 Replies)
Discussion started by: raghu.iv85
6 Replies

10. UNIX for Dummies Questions & Answers

Script Problem-Processing multiple scripts

Hi All, I have four scripts to run. My 1st script will make script2 and script3 to run. I am setting a cron job for this script1 to run continuously. This script1 will check for 2 text files and based on the existance of those text files it will initiate the script2 and script3. Now my doubt... (2 Replies)
Discussion started by: RSC1985
2 Replies
Login or Register to Ask a Question