Solved

Shell help ftp retry

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

920 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

17 Experts available now in Live!

Get 1:1 Help Now