I'm running this on both solaris and hp boxes, ftping from windows, then ftping to an aix machine.
If I run the ftpReportFile by itself, I get info in the ftp_rpt_log. If I run just the 2 ftps together, I also get output. However, if I run the entire shell script, I don't get output from ftpReportFile. And ftpReportFile is failing saying it can't find the file. Please help.
ftpEngine() {
ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR1}
cd ${FTP_dir2}
bin
mget ${FTP_FILE}
quit
EOF_FTP
mv engine.tar.Z $HOME/"$CURRENT_VERSION"/"$test_type"/engine.tar.Z
}
ftpReportFile() {
ftp -inv ${FTP_REPORT_SERVER} << EOF_FTP > ${FTP_RPT_LOG} 2>&1
user ${FTP_USER} ${FTP_REPORT_PSWD}
cd ${FTP_REPORT_DIR}
pwd
bin
put ${REPORT_FILE}
quit
EOF_FTP
}
error when I do get output:
Connected to xxxx.
220 xxxx FTP server (Version 4.1 Thu Jun 21 14:19:12 CDT 2007) ready.
331 Password required for qainst01.
230-Last unsuccessful login: Tue Nov 13 15:10:58 EST 2007 on /dev/pts/0 from xxxxx
230-Last login: Thu Nov 15 12:58:03 EST 2007 on ftp from xxxx
230 User qainst01 logged in.
250 CWD command successful.
257 "/home/qainst01/50" is current directory.
200 Type set to I.
200 PORT command successful.
553 /export/home/qainst01/50/SUN_50_Report.txt: A file or directory in the path name does not exist.
221 Goodbye.
$ pwd
/export/home/qainst01/50
$ ls SUN*
SUN_50.sh SUN_50_log.txt SUN_50_previous_log.txt SUN_50_Previous_Report.txt SUN_50_Report.txt