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.

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 06:12 AM
AIX & Solaris 10 problem talashil SUN Solaris 1 04-30-2008 02:21 PM
problem ftp solaris 10 gonzo SUN Solaris 1 01-29-2008 10:55 AM
Solaris 10 - X Problem pc9456 SUN Solaris 5 04-18-2007 10:47 AM
problem in solaris 8 fuqiang1976 UNIX for Dummies Questions & Answers 1 09-05-2001 04:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-05-2005
Registered User
 

Join Date: May 2005
Posts: 48
Stumble this Post!
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.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-05-2005
andryk's Avatar
Registered User
 

Join Date: Sep 2003
Posts: 448
Stumble this Post!
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 ...
Reply With Quote
  #3 (permalink)  
Old 12-05-2005
Registered User
 

Join Date: May 2005
Posts: 48
Stumble this Post!
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?
Reply With Quote
  #4 (permalink)  
Old 12-05-2005
Registered User
 

Join Date: Oct 2002
Posts: 670
Stumble this Post!
This site has some codes
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:34 PM.


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

Content Relevant URLs by vBSEO 3.2.0