?
Solved

Shell help ftp retry

Posted on 2015-01-29
5
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 62

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 62

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 62

Accepted Solution

by:
gheist earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Fine Tune your automatic Updates for Ubuntu / Debian
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 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