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
calling a script from a level above where the script resides SummitElse UNIX for Advanced & Expert Users 2 10-26-2007 06:27 AM
calling a script from another madhu_aqua14 UNIX for Dummies Questions & Answers 2 02-27-2007 03:16 AM
Box A's perl script calling box B's shell script new2ss Shell Programming and Scripting 1 09-13-2006 03:17 AM
calling dos2unix on shell script from within the script vino Shell Programming and Scripting 4 04-08-2005 12:38 AM
Calling a script from another dnkansah Shell Programming and Scripting 5 09-02-2004 04:02 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-16-2007
Registered User
 

Join Date: Nov 2005
Posts: 91
Unable to FTP while calling another script

Hi,

I am trying to use a generic script called ftp_master.ksh and use it in my script to FTP multiple files and log them. But I am unable to do so. I am not sure where I am going wrong...

My script:

Code:
SERVER=$1
REMOTE_FILE_PATH=$2

file_count=`expr $# - 3`
echo "Total files to be ftped : ${file_count} "

LOCAL_FILE_PATH=/apps/inbound
LOG_FILE=$LOG_DIR/ftpPullFiles_log.${RUNTIME}

cd ${LOCAL_FILE_PATH}

#------------------------------------------------------
#             File 1
#------------------------------------------------------
REMOTE_FILE_NAME=$3

$SCRIPTS/ftp_master.ksh -g -s ${REMOTE_FILE_PATH}/${REMOTE_FILE_NAME} -d ${LOCAL_FILE_PATH}/${REMOTE_FILE_NAME} -v {SERVER} >
 $LOG_FILE

files_trnsf=`grep -c ^"226 " ${LOG_FILE}`

if [ "$files_trnsf" -eq 1 ]
then
  echo "File ${REMOTE_FILE_NAME} FTPed Successfully from ${SERVER}"
  #rm ${LOG_FILE}
else
  echo "ERROR occured while FTPing file ${REMOTE_FILE_NAME} from ${SERVER}."
  echo "See log ${LOG_FILE} for details"
  exit 1
fi

if [ "$file_count" -eq 1 ]
then
  exit 0
fi
ftp_master has parameters like -g (get), -s (source filename), -d (destination filename) and -v (server)....

I think the log file generated doesn't have the code 226 or something....

I would appreciate your help...
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-16-2007
Registered User
 

Join Date: Aug 2005
Location: Bangalore
Posts: 196
what is the exact ouput you are getting? and why dont you post the source code of ftp_master.ksh Or try this

Last edited by ahmedwaseem2000; 02-16-2007 at 09:55 AM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:40 AM.


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