The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exception Handling bertpereira Shell Programming and Scripting 5 01-14-2009 09:28 PM
Error Handling in Korn Shell scripts bhgopi UNIX for Advanced & Expert Users 4 09-06-2005 06:44 PM
exception handling RichardS UNIX for Advanced & Expert Users 1 06-16-2004 05:29 PM
Parameter handling AkumaTay UNIX for Dummies Questions & Answers 1 05-18-2002 02:09 PM
Date Handling AkumaTay UNIX for Dummies Questions & Answers 1 08-16-2001 02:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-23-2008
vivek_damodaran vivek_damodaran is offline
Registered User
  
 

Join Date: Sep 2005
Location: Milton Keynes, UK
Posts: 20
Handling ftp error

I have a script which connects to remote server and ftp the files
It works fine, however if there is any failure in ftp connection can it be handled???

Code:
ftp log

ftp session start time is: Thu Jun 19 00:00:02 BST 2008
Not connected.
Not connected.
Interactive mode off.
Not connected.
Not connected.
Not connected.
success and proceed
ftp session end time is: Thu Jun 19 00:01:18 BST 2008
I have tried the following, but in vain

ftp -n $HOST > /tmp/ftp.worked 2> /tmp/ftp.failed <<END_SCRIPT
<code>
END_SCRIPT

EXITSTATUS=$?
if [ $EXITSTATUS != "0" ]
then
# handle the error...
fi


Can someone please help me?

Thanks
  #2 (permalink)  
Old 06-23-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,509
you can try the debug flag -d as well as the verbose flag -v. check your ftp man page
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0