retry process in ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting retry process in ftp
# 1  
Old 12-11-2006
retry process in ftp

hi #!/bin/bash
SERVER=10.89.40.35
USER=xyz
PASSWD=xyz

ftp -in $SERVER<<EOF
user $USER $PASSWD
mkdir PPL
cd /path of remote dir
lcd /path of local dir
hash
bin
put <file name>
bye
<<EOF

The above ftp script i have to schedule in crontab at a particular instance of time run daily.
In the above ftp script i have to implement a retry process.
So that in the case if the transfer is stopped in between ftp for any reasons then after a gap of 15 mins the ftp session again retry to do the ftp.

This is done so that the person at remote server where the files are to be dumped get an idea that some problem lies in connectivity if ftp fails..after a no. of retries .

PLS if anybody cld help in writin the code for it..
# 2  
Old 12-11-2006
no cyber chat forms please... Smilie

probably i could help with you an idea..

for ftp transfers,
include site checksums to verify the transfer
and the size of the file, whether they do match or not
and of course the successful transfer message ( check from the RFC's ) .

If any of them gives unsatisfactory results then necessarily the job needs to be scheduled.
Kind of more idea would be to have a list of files to be transferred and a marker about the transfer status of the file in a seperate (special) file and update the special file accordingly based on the run.. so next time running by cron.. no need to specify the file to be transferred again

hope that gives an idea
# 3  
Old 12-16-2006
Hey..i need..a..unix...ftp script..which transfers a file to sme other server..and if the transfer is succesfull then the file is moved to smeother directory...and if not..then..it shld remain in same directory.....

..pls if anybody..cld..help writin..d same..!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Unrecovered read error No retry

We encountered these error 2 times(e.g. Solaris 10 with NetWorker installed) with in the month of August, but we couldn't pin point the root cause, it might be bad sector, bad cable or software incompatibility? Do you experience these issue or please share your understanding about this? Thanks... (0 Replies)
Discussion started by: B@S
0 Replies

2. UNIX for Dummies Questions & Answers

Wget retry on 500 internal error

Hello Guys, I am trying to generate static site, I have perl script that wget the url, so the problem is sometimes wget has 500 internal error, this is failing to get that page. So I am thinking of retrying that url with 500 response. system $command = 'wget ... -i inputfile -o outfile" Is... (2 Replies)
Discussion started by: neal
2 Replies

3. Shell Programming and Scripting

Script to retry FTP commands if unsuccessful and capture the failure status code.

I am using the below code to ftp file onto another server FTP_LOG_FILE=${CURR_PRG_NAME}- ${FTP_FILE}-`date +%Y%m%d%H%M%S`.log ftp -ivn ${FTP_HOST} ${FTP_PORT} << ENDFTP >> ${EDI_LOG_DIR}/${FTP_LOG_FILE} 2>&1 user ${FTP_USER} ${FTP_PSWD} lcd... (2 Replies)
Discussion started by: akashdeepak
2 Replies

4. Shell Programming and Scripting

If then else - Retry operation

I need to read a file line by line, then depending on the contents of each line, type in a code that will get written to an array. The problem I have is when I ask the user to confirm the input code, if it is wrong, how do i Return to ask again? Any thing I try increments the file to the next... (6 Replies)
Discussion started by: kcpoole
6 Replies

5. UNIX for Advanced & Expert Users

How to manipulate the conditions between every retry in wget?

Hi , When i hit the URL using WGET command ,it is retrying according to the number of retry we mentioned along with Wget command. my expectation : 1) If 1st try is failed and iam retrying again before 2nd retry i have to check for "xxxxxxx" entry in the log file. 2) If "XXXXXXX" entry is... (4 Replies)
Discussion started by: vinothsekark
4 Replies

6. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

7. Shell Programming and Scripting

Shell Script to Retry and Exit

ok, so I'm trying to add a function to my local script that runs a command on a remote host. The reason why this is needed is that, there are other scripts that run different commands on the same remote host. so the problem is that many times there are multiple scripts being run on the remote... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

Retry upon FTP failure

I am using the following code in a C Shell script to transfer files to a remote server: ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1 quote user $user_name quote pass $password ascii put $js_file_name bin put $FinalZipFile quit DO_FTP1 This code works great except on those rare occasions... (8 Replies)
Discussion started by: phudgens
8 Replies

9. Shell Programming and Scripting

Retry every ten seconds while lockfile present

Hi, I have written below check lockfile script but need some tweaking on it. If there is a lockfile from present, I need the script to retry every 10 seconds to see if the lockfile is still there. After 120 seconds it should send an email. In my current version, if the script encounters... (6 Replies)
Discussion started by: Meert
6 Replies

10. UNIX for Advanced & Expert Users

Enomem in Journal Retry Error

Hi, Does anyone seen this error before.. kernel: ENOMEM in journal_alloc_journal_head, retrying. I encounter this problem on IBM eServers where when the above error appears usually the machine is dead or hanged. Unless a hard reboot is been done. Is this something have to do with the memory... (1 Reply)
Discussion started by: killerserv
1 Replies
Login or Register to Ask a Question