Solved

Shell help ftp retry

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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.

717 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