The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-24-2008
Registered User
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 99
regarding FTP

hi frnds..

hi have a FTP script..
How can i chk whether file/files has been ftp'd successfully.

coz if they are not.. I need to ftp it again...

pl hlp..

thanks.

anchal.
Reply With Quote
Forum Sponsor
  #2  
Old 01-24-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
use ftp's "ls" command to check for the filename, put the whole thing in some "if then else" condition.
This is generic answer, since you didn't show the relevant parts of your script.
Reply With Quote
  #3  
Old 01-24-2008
Registered User
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 99
thanks for the reply.
but ..i didnt get what i can get with "ls".

..
actually my prob is that I wnt to chk for the file size..if its zero KB thn I need to ftp it again....and/or 'll send a mail..

so how can i chk for the file size on ftp prompt..??
Reply With Quote
  #4  
Old 01-24-2008
Registered User
 

Join Date: Jan 2008
Posts: 52
You can do ls -s in ftp
Reply With Quote
  #5  
Old 01-24-2008
Registered User
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 99
how can i implement this... :-(

if I m not wrong ls -s give the used space..... but it doesnt gives the size...
Reply With Quote
  #6  
Old 01-24-2008
Registered User
 

Join Date: Jan 2008
Posts: 1
Its always better to map the checksum of the file .... at source and destination pool. if the checksum is matched... then ..file is copied successfully.. for sure..

Use " cksum " for the file size varification .
Reply With Quote
  #7  
Old 01-24-2008
Registered User
 

Join Date: Jan 2008
Posts: 52
The -s option gives the file size in blocks, including indirect blocks, for each entry.

Other than some specified commands, you cannot use it in ftp mode. So better to delete zero byte files in the landing directory and start the ftp for those file again..

Need to see your code...........
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0