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
/var/adm/messages error sunsri01 SUN Solaris 2 11-09-2007 11:33 AM
error messages murad.jaber SUN Solaris 0 10-11-2007 02:02 AM
error messages in /var/adm/messages nitinp82 UNIX for Advanced & Expert Users 1 04-17-2007 10:17 AM
Error Messages akrathi UNIX for Dummies Questions & Answers 1 10-26-2005 12:01 PM
error in /var/adm/messages julie UNIX for Dummies Questions & Answers 2 08-08-2001 04:10 PM

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 10-19-2007
dineshr85 dineshr85 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 23
ftp error messages!

Please see the below script-

ftp $FTPREMOTESERVER
prompt
mput $DATAPATH/*.dat
quit | ftp -in > FTPRETURNMSGLOGFILE # iam trying write the eroor messages inside a file when the ftp quits.

Based on the above script te ftp is properly working but writing into the file wen ftp quits is nor working.Any suggestions
  #2 (permalink)  
Old 10-19-2007
DAFNIX DAFNIX is offline
Registered User
  
 

Join Date: Sep 2006
Location: Perth
Posts: 3
Hi This is what I do
hope it helps

#
# launch ftp program and write to FTP_LOG FILE
#
FTP_LOG= ${USR_HOME}"FTP_LOG".lis

$FTP_PROG $USR@$IPN -pw=$PSS -ce -unat=y -cmd="$CMDS;" >>${FTP_LOG}
RTNCD=$?
#
#check the return code for error
# look for error message in the log and email admin
#
if [[ !0 = $RTNCD ]]
then
echo "FTP ERROR: "$RTNCD >>$O_ERR
awk -F '[:.]' '$1 == "Warning" { print $2 }' ${USR_HOME}${FTP_LOG}
>>$O_ERR
awk -F '[:.]' '$1 == "Error" { print $2 }' ${USR_HOME}${FTP_LOG}
>>$O_ERR
send_mail
fi
Sponsored Links
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 11:06 AM.


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