Solved

Shell help ftp retry

Posted on 2015-01-29
5
215 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Recover Lacie Edmini data. 11 75
Renaming with batch file 9 106
Granting root permissions to a user (in Debian Jessie) 17 77
check the file dates in unix 14 75
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

738 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