Solved

Shell help ftp retry

Posted on 2015-01-29
5
201 Views
Last Modified: 2015-02-16
Hi Experts,

I am getting file values as argument in the format 1.txt,2.txt,3.txt
Loop for all txt_files
 exec procedure sp_book_cnt
If returnStatus=Y
   ftp txtfile
echo "FTP Success"
Else
sleep 60
goto procedure sp_book_cnt until File ftp success or until returnsflag=N            

sp_book_cnt will check for retry cnt, if its >10 it should send status (returnFlag) as N.      

How can i achieve this?

Thanks,
Magento
0
Comment
Question by:magento
  • 3
  • 2
5 Comments
 
LVL 61

Expert Comment

by:gheist
ID: 40579129
Why not use wget?
0
 
LVL 5

Author Comment

by:magento
ID: 40597769
Sorry for late response ..
How can wget solve my issue , also please be advice i was supposed to use FTP in my project.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40597788
Check -c option for wget
You can have many different shining FTP downloaders, like curl, ncftp or aria2, or replacements like rcp, or secure replacements like scp or rsync.
0
 
LVL 5

Author Comment

by:magento
ID: 40601101
Hi Gheist,

Sorry i dont understand ur points on different FTP downloaders. My question is how to handle the ftp count.

Say i send a first book 1.txt to another server via ftp command . If its success i will process next book 2.txt.
If 1.txt fails, i will try reftp the file until its success but only reftp 10 times . If still 10 times fails, it should throw error.

How can i do this in shell scripting.?

Thanks
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 40601172
No mention of uploads khem khem khem

ncftp handles that almost instantly... Just pass it list of files and get the log of output...
other option is to wrap default ftp client with expect (ftp -i is one shot, if it misses it misses)

Other options are sadly for downloads
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now