FTP script - 'quit' never executes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP script - 'quit' never executes
# 1  
Old 08-01-2011
FTP script - 'quit' never executes

I have wrote a script to get a very large encrypted file from a remote ftp server to a local debian box.
The file downloads successfully, but the script never exits, or quits. None of code executes after the ftp get command.
The file is approx 291M

Here is the code:

Code:
!/bin/sh
WORKING_DIR=/home/jstrahm/AgencyWorks
LOG=$WORKING_DIR/log.txt
PGP_FILE=AiData.zip.pgp
AGWORKS_USER=xxxx
AGWORKS_PASWD=xxxx
AGWORKS_FTP="xxxxxx.com"

echo "`date` --BEGIN Get Replicator File" >> $LOG
# (1) Download the AgencyWorks encrypted zip file from Agency Works
ftp -niv $AGWORKS_FTP >> $LOG <<END_SCRIPT
quote USER $AGWORKS_USER
quote pass $AGWORKS_PASWD
binary
lcd $WORKING_DIR
get $PGP_FILE
quit
END_SCRIPT
echo "`date` --END Get Replicator File" >> $LOG
exit 0


Last edited by Franklin52; 08-02-2011 at 04:32 PM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 08-01-2011
You can try
close command instead of quit
then you can issue bye command
# 3  
Old 08-01-2011
h@foorsa.biz

Thank you for the suggestion. I did try it, but the same results; nothing after the get command is executed.Smilie
# 4  
Old 08-03-2011
I noticed that even though the file completely downloads from the FTP Server, the FTP Server never replies with the 226 code of "Transfer Complete"

Could this be an issue with the FTP Server or my FTP Client?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Will shell script executes in sequence

I have a shell script scheduled in cron job to run at every 1 minute which transfers files to remote machine and then move the files to backup folder. cd /u01/app/ftp_tmp sftp user@hostname <<-EOF cd /home/user/ftp mput * bye EOF mv /u01/app/ftp_tmp/* /u01/app/ftp_bkp Now the problem is... (6 Replies)
Discussion started by: Bhavi
6 Replies

2. UNIX for Dummies Questions & Answers

Script partially executes??

Hi All, I am calling a shell script from another shell script, however, it only executes part of it (the echo commands only). What could be some causes for that? For example: ShellScriptA.sh: ... ... ... . ShellScriptB.sh ShellScriptB.sh contents: echo date echo... (7 Replies)
Discussion started by: DBnixUser
7 Replies

3. Shell Programming and Scripting

script executes some time but not always.

I have following script to send email when a USB is attached. #!/bin/bash NUMBER=`/bin/cat /u/numberoflines` LINES=`/usr/bin/wc -l < /var/log/messages` DIFFERENCE=$(($LINES-$NUMBER)) if ; then tail -n $DIFFERENCE /var/log/messages |while read line do if $( echo $line | grep --quiet... (2 Replies)
Discussion started by: kashif.live
2 Replies

4. Shell Programming and Scripting

Quit FTP issue

Hey, same problem. i want to check if files have been successfuly transferred after getting them back, but after I quit the ftp, nothing gets executed. Difference from original post is that I get 226 and 221 feedbacks from the server. 226 Transfer complete. 2409 bytes received in 0.0086... (5 Replies)
Discussion started by: fpflug
5 Replies

5. Windows & DOS: Issues & Discussions

Batch script executes twice

Hi, Batch script gets executed without any error, but on execution some of the partial contents of the batch file gets appended at the end of the file which is currently in execution, hence the script tries to execute again for the second time , which should not happen. How to get it... (5 Replies)
Discussion started by: milink
5 Replies

6. UNIX for Dummies Questions & Answers

If FTP cron job fails to connect = quit

Im having a problem with my ftp CRON jobs. I have another related (but not the same question in shell scripting). My FTP CRON jobs connect to a server and drop some files off, if for some reason it cannot connect to the server (timesout/password wrong etc) instead of stopping, it tries again... (3 Replies)
Discussion started by: mokachoka
3 Replies

7. Shell Programming and Scripting

root executes a script as another user

Hi All, Am using the below command to start my application using the root user su - bin -c "/home/bin/test/start.sh" but am getting the error becaue i have set some environment varibales in bin's .profile when i execute the command start.sh by logging directly into bin account it's... (9 Replies)
Discussion started by: ravi.sri24
9 Replies

8. Shell Programming and Scripting

root executes a script as another user

we have this script that stops, starts and monitor process scheduler. prcs_control. this script runs perfectly when executed by ps_user. we are now creating a new script that will run this script and is executed by root. this script needs to execute the prcs_control as ps_user because root can... (1 Reply)
Discussion started by: tads98
1 Replies

9. Shell Programming and Scripting

Executing statements after quit in FTP.

In my shell script I am doing FTP along with other process. But all the statements after the "quit" command in FTP are not getting executed. Example: echo "This is a shell script to FTP a file" #ftp -inv <server name> <<eol>> <logfilename> #user <userid> <password> #put <filename> #quit... (2 Replies)
Discussion started by: dharmesht
2 Replies
Login or Register to Ask a Question