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 > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Denying IPaddress for Multiple Failed Login Attempts metzgerh AIX 1 12-13-2006 04:13 PM
Failed to check status code in "rsh" command nir_s Shell Programming and Scripting 9 07-03-2006 09:05 AM
invalid login attempts... mr_manny SUN Solaris 6 12-01-2005 02:10 PM
Failed dependencies of rpm / how does RPM check for ? mod Linux 2 09-20-2003 07:33 PM
AIX logon attempts eysheikah Security 0 06-20-2003 09:24 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 01-24-2007
chlawren chlawren is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 37
ftp check for failed attempts

Hi,

I have created the below ftp script to put files over to our capacity server, the check at the end works if ftp fails to run however if the script cannot login or the transfer itself failed there is no warnings.

Does anyone know the syntax to trap the erorr codes or to put a check within FTP?

Thanks a million ....

# create an ftp script to move the data to sftp

echo "ftp -v -i -n $SERV <<!EOF" > $FTP
echo "user capacity.ftp C@p@C1ty" >> $FTP
echo "binary" >> $FTP
echo "prompt" >> $FTP

# Find the processed nmon file to be sent to capacity server for processing:

cd $OUTDIR
PDATE=`perl -le '($year,$mon,$day,$hrs,$min)=(localtime(time()-$ARGV[0]))[5,4,3,2,1];printf "%04d%02d%02d_%02d\n",$year+1900,$mon+1,$day,$h
rs,$min' 3600`
TFILE=`ls ${NFILE}_${PDATE}*.csv`


if [ -f ${OUTDIR}/${TFILE} ] ; then

continue

else

logfile "$TFILE is not available for transfer, please investigate and transfer the file."
exit 1
fi


echo "mput $TFILE" >> $FTP
echo "$DATE:$TIME//Transfering $TFILE to $SERV " >> $PROGLOG
echo "!EOF" >> $FTP
chmod 777 $FTP

#$FTP

if [ $? -ne 0 ] ; then

logfile "failed to FTP $TFILE to $SERV"
fi
  #2 (permalink)  
Old 01-24-2007
MizzGail's Avatar
MizzGail MizzGail is offline
Registered User
  
 

Join Date: Sep 2001
Location: Syracuse, NY
Posts: 164
In my code I have directed the output of the ftp process to a file and then interrigate the file for verbage.

ftp $rmthost <<COMMANDS>> $ftplog 2>&1

checkftp=`grep -c "Transfer complete" $ftplog`
if (($CHECKFTP > 0 )); then
mailx -s "error" me@mymailaddress < $ftplog
else
echo "ftp ok" > $joblog
fi
  #3 (permalink)  
Old 01-24-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
take a peek here
  #4 (permalink)  
Old 01-26-2007
chlawren chlawren is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 37
groovey!

thanks both for your help
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:02 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