Sponsored Content
Top Forums Shell Programming and Scripting Unable to FTP while calling another script Post 302107397 by madhunk on Friday 16th of February 2007 11:24:50 AM
Old 02-16-2007
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...
 

10 More Discussions You Might Find Interesting

1. AIX

Unable to FTP a file

Hi Guys, I am not able to ftp a file from one server to another server. The target server is a Mainframe server. i am able to login to the server but when i run the ftp command, i am getting this error 550-SVC99 RETURN CODE=4 S99INFO=0 S99ERROR=38668 HEX=970C S99ERSN code X'000042CE'. 550... (1 Reply)
Discussion started by: mac4rfree
1 Replies

2. Solaris

Unable to perform FTP from Window to OpenSolaris

Hi All, I installed OpenSolaris and I try to do FTP from window to opensolaris via WinSCP 3.7.6 then I am getting the following error-- Couldn't agree a client-to-server cipher(available: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour)Please provide me your valuable... (3 Replies)
Discussion started by: smartgupta
3 Replies

3. Shell Programming and Scripting

After FTP unable to move file to other location

Hi Experts, I am using below script and facing some problems.. cd /home/user/test rm ftp://ftp.log Example: A_Bachfile_09292011.txt A=`ls -1 "A*.txt"` compress $A C=`ls -1 "A*` hostname="test.gmail.com" user="raju" Password="******" ftp -n $hostname <<EOF >>ftp.lpg... (4 Replies)
Discussion started by: rajubollas
4 Replies

4. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

5. Shell Programming and Scripting

Unable to get the size of remote file using Net::FTP Perl Script

Hi, I am using below piece of code to get the size of the remote file. $ftp->cwd($destination) or $error=$ftp->message; if(!$error) { $ftp->put($file) or $error=$ftp->message; print "FTP size = \n"; ... (3 Replies)
Discussion started by: FarooqOnline
3 Replies

6. Shell Programming and Scripting

unable to pass value to user prompt from calling shell script

This is my script structure main script calls configure script which needs to be run as a different user and the configure script calls my application installation script. the application instruction script prompts the user for a directory which I need to pass from my main or configure script. ... (4 Replies)
Discussion started by: cmastays
4 Replies

7. AIX

FTP Server Unable to Login

FTP Server in P590 machine was unable to login, Torwing error while login. Tried to change password through maintenance mode by running AIX 5.3 OS CD, But CD row was unable to detect for the particular LPAR. Please Suggest ASAP. (3 Replies)
Discussion started by: marunmeera
3 Replies

8. Solaris

Unable to create a ftp user only

Hi all I am facing difficulties when using the useraddcommand. when running useradd -u 60006 -g 100 -d /opt/xxx/yyy/z -m -s /bin/false ftpuser It does create the user, but with a wrong home directory. It creates its home directory at /home/ftpuser Please can you help? (2 Replies)
Discussion started by: fretagi
2 Replies

9. Solaris

Unable to connect using ftp

hi I am having issues when trying to connect using ftp, I am having the following error: User (10.100.48.73:(none)): moz 331 Password required for moza. Password: 530 Login incorrect. Login failed. ftp> by 221 Goodbye. I have created a user like this: useradd -g 10 -d /lam/moza -m -s... (11 Replies)
Discussion started by: fretagi
11 Replies

10. Shell Programming and Scripting

Unable to Download File from FTP

Hi, I am trying to download files from FTP using below FTP code. x=$(TZ=CST date +%Y%m%d) host='xxx.xx.xxx.xxx' user='userX' pass='Password' echo "Connecting to FTP Host -- $host....." echo $x a=$(ftp -v -n -i << ! open $host user "$user" $pass cd /rose/yellow/ mget... (6 Replies)
Discussion started by: rramkrishnas
6 Replies
HOLDINGNUTS-SERVER(6)						HoldingNuts manual					     HOLDINGNUTS-SERVER(6)

NAME
HoldingNuts - a poker client and server SYNOPSIS
holdingnuts-server [-c config-dir ] DESCRIPTION
HoldingNuts is an open source multi-platform poker client and server. You can play the popular Texas Hold'em variant with people all over the world, meet your friends, run your own games and even setup your own poker-network. This is the server part which runs the games and listens on a specific port (default: 40888) for client connections. OPTIONS
-c config-dir Use an alternate config-dir instead of the default ~/.holdingnuts. FILES
~/.holdingnuts/server.cfg The default server configuration file. ~/.holdingnuts/server.log The default server log file. WWW
The project webpage: http://www.holdingnuts.net/ The project wiki: http://wiki.holdingnuts.net/ The online manual: http://wiki.holdingnuts.net/manual AUTHOR
Dominik Geyer <dominik.geyer@holdingnuts.net> is the main author, but the whole list of contributors is found at http://www.holdingnuts.net/about SEE ALSO
holdingnuts(6) Dominik Geyer Version 0.0.5 HOLDINGNUTS-SERVER(6)
All times are GMT -4. The time now is 04:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy