Ftp script hangs for first time,but works every second time


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ftp script hangs for first time,but works every second time
# 1  
Ftp script hangs for first time,but works every second time

Hi

I have an ftp script which works fine when i execute through a test scheduler(UC4), but when i run it through the prod scheduler(UC4), it hungs indefinetely, when we cancel the job and re-run it it works perfectly fine. here is the code,, any idea why this is happening ????

Code:
#!/usr/bin/ksh
##
## Oracle-DB setting profile load.
CTRON_WEBUTL_PROP=/etc/ctronwebutl.profile
if [ -e "${CTRON_WEBUTL_PROP}" ];then
. ${CTRON_WEBUTL_PROP}
else
echo "CTN-E-019999 NO ${CTRON_WEBUTL_PROP} found, set ${CTRON_WEBUTL_PROP} environmental variable"
logger "CTN-E-019999 NO ${CTRON_WEBUTL_PROP} found, set ${CTRON_WEBUTL_PROP} environmental variable"
exit 9
fi
## Source profile for stand-alone testing
if [ -z "$ETOILE_PROFILE" ];then
ETOILE_PROFILE=/etc/etoile.profile
fi
if [ -f "$ETOILE_PROFILE" ];then
. ${ETOILE_PROFILE}
else
echo "CTN-E-019999 NO ETOILE_PROFILE found, set ETOILE_PROFILE environmental variable"
logger "CTN-E-019999 NO ETOILE_PROFILE found, set ETOILE_PROFILE environmental variable"
exit 9
fi
echo "CTN-I-010000 (Transparency_Guideline_Data_Report) EXEC FTP."
logger "CTN-I-010000 (Transparency_Guideline_Data_Report) EXEC FTP."
DATE=`date +%Y%m%d%H%M%S`
ftp -n servername << CMDEND
user dummy ***passwd**
lcd ${FOCUS_ROOT}/intf/activeout
cd /f001/sftp/hlc/tr/in/JAPAN
put ST11_Payment_AP.utf ST11_Payment_AP_$DATE.UTF
put ST11_Payment_GL_VR.utf ST11_Payment_GL_VR_$DATE.UTF
put ST11_Payment_GL_OT.utf ST11_Payment_GL_OT_$DATE.UTF
bye
quit
CMDEND
echo "CTN-I-010000 (Transparency_Guideline_Data_Report) FTP END."
logger "CTN-I-010000 (Transparency_Guideline_Data_Report) FTP END."
## Exit
exit 0

# 2  
Remove the sapce before CMDEND
Code:
ftp -n servername <<CMDEND
user dummy ***passwd**
lcd ${FOCUS_ROOT}/intf/activeout
cd /f001/sftp/hlc/tr/in/JAPAN
put ST11_Payment_AP.utf ST11_Payment_AP_$DATE.UTF
put ST11_Payment_GL_VR.utf ST11_Payment_GL_VR_$DATE.UTF
put ST11_Payment_GL_OT.utf ST11_Payment_GL_OT_$DATE.UTF
bye
CMDEND

Hope this will help you. !!
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #435
Difficulty: Medium
Angular and AngularJS are web application frameworks to use for developing multi-page web applications.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies

2. Shell Programming and Scripting

Script in bash that works only some of the time

I ran this script yesterday (in the background) /usr/bin/nohup myfilelocation/myscriptname.sh & the script worked perfectly. i ran it today (also in the background) and just sat there. So i killed it and ran it normally and it worked perfectly. Anyone suggest why it just sat there and... (8 Replies)
Discussion started by: twinion
8 Replies

3. Shell Programming and Scripting

what would a script include to find CPU's %system time high and user time high?

Hi , I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( . how to find cpu's system high time and user time high in a script?? thanks , help would be appreciated ! :) (9 Replies)
Discussion started by: sushwey
9 Replies

4. Shell Programming and Scripting

ftp multiple files at the same time

Hi All, I am using ncftpput in one of my c-shell script to upload files to a remote location. The source files keep coming continuosly and to upload each file ncftpput opens a new connection everytime. It means ncftp uploads the file1 than file2 than file3 .... There is gap 20-25 secs between... (10 Replies)
Discussion started by: sraj142
10 Replies

5. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

6. UNIX for Dummies Questions & Answers

machine hangs for some time after giving password.

Hi I m trying to take a console of linux machine using putty. Whenever i connect to the machine and give password details to log into the machine it hangs for some time and then it allow the login. I m totally clueless why it is happening suddenly . ---------- Post updated at 01:14 AM... (1 Reply)
Discussion started by: pinga123
1 Replies

7. HP-UX

Strange- RCP command works every other time

This just started happening. I use the rcp command to copy a file from one server to another. Now when I use the command, every other time I execute the exact same command I get the error: remshd: login correct Example: 1. rcp testfile server2:/db/tmp (Work ok, verified file... (6 Replies)
Discussion started by: jrowland
6 Replies

8. Shell Programming and Scripting

append date time stamp via ftp script

I have searched several thread and not found my solution, so I am posting a new qustion. I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name. I need to FTP the files to the MS server, but... (1 Reply)
Discussion started by: sknisely
1 Replies

9. SuSE

Regarding Time Stamping in the FTP Server

How can i change the FTP Server time stamping? Problem is 1. Our server timing is Fri Feb 13 14:17:22 SGT 2009 2. Out FTP Server timing is GMT Can anyone tell me how can i make the FTP Server timing is our local timing? (5 Replies)
Discussion started by: kingganesh04
5 Replies

10. UNIX for Dummies Questions & Answers

ftp time on Solaris 8

Hello all, Does anyone know how to set the timeout limit on Solaris ftp machine. Thanks all (2 Replies)
Discussion started by: larry
2 Replies

Featured Tech Videos