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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
NFS problem on Solaris 8 shamsul SUN Solaris 0 05-31-2008 10:12 AM
AIX & Solaris 10 problem talashil SUN Solaris 1 04-30-2008 06:21 PM
problem ftp solaris 10 gonzo SUN Solaris 1 01-29-2008 02:55 PM
Solaris 10 - X Problem pc9456 SUN Solaris 5 04-18-2007 02:47 PM
problem in solaris 8 fuqiang1976 UNIX for Dummies Questions & Answers 1 09-05-2001 08:54 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-05-2005
BCarlson BCarlson is offline
Registered User
  
 

Join Date: May 2005
Posts: 48
Question Solaris 9 - Ftp problem

I was wondering if anyone can help me out with a Solaris 9, FTP problem.

The problem is this. One of our scripts recently attempted to send files to a MS server, using FTP, and some error occurred. Because the script didn't trap for errors we didn't know about the problem until things started failing down the line.

My task now is get the script to capture any errors that occur. Normally, I'd just grep for 'bytes sent' in the output file but, it appears as if the 'mput *' command doesn't give out that information.

Here's the snipet of code that does the FTP (server-name/user-id/password are changed):

--------------------
ftp -n server-name<<END-FTP > /tmp/$$soft1
user user-id password
cd dcview/routlist
lcd /work_str/circ/softbook/concat
prompt
mput *
quit
END-FTP
--------------------

When the FTP is successful the /tmp/$$soft1 file contains the following two lines:

Local directory now /work_str/circ/softbook/concat
Interactive mode off.

Now, at this point in the script I could grep the /tmp/$$soft1 file if I knew what I was looking for. Is there a list somewhere of all the possible errors that could occur that I could grep for? An alternate solution, I suppose, would be some way to determine if these two lines were 'all' the file contains.

Any help would be greatly appreciated.
  #2 (permalink)  
Old 12-05-2005
andryk's Avatar
andryk andryk is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2003
Posts: 448
Modify your ftp line so that it redirects *all* output to /tmp/$$soft1

Code:
ftp -n server-name<<END-FTP > /tmp/$$soft1 2>&1

Hopefully, it will catch any error helping you to troubleshoot the pb ...
  #3 (permalink)  
Old 12-05-2005
BCarlson BCarlson is offline
Registered User
  
 

Join Date: May 2005
Posts: 48
I agree that doing that will allow me to capture the errors in the output file however, it doesn't abort the script if there is an error. I need to know how to tell if there was an error. What do I look for? Is there a list of possible errors somewhere?
  #4 (permalink)  
Old 12-05-2005
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
This site has some codes
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 10:53 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