Capturing FTP logs

Hi Guys,

I am trying to capture the FTP Logs in a log file.

I am using the below code.

ftp -d -n -v $Remote_Host << EOD > $Ftp_LOG;

Since iam running the script in debug mode, i am able to see that the ftp is done and the file has been transferred.

But the log file does not have any entries..

Can somebody help me with it.

Cheers!!!!

did you try this -

ftp -d -n -v $Remote_Host << EOD | tee -a $Ftp_LOG;

Yes i tried using tee also.. It did not work too...
Can somebody help me out here..
Thanks in advance..

Shouldn't it be with 2>&1 ?

you get limited info redirected in log when you use -d option. i am getting logs for below code -

ftp -dnv $SAMS_FTP_HOST << EOF_FTP |tee -a ${patch_holding}/ftplog
   user $ftplogin $PASS
   lcd $patch_holding
   cd patch
   binary
   prompt off
   mget $fileset
   bye
/patch_install/get_1667282> cat ftplog
Connected to sams-mal-ftp.internal.sungard.corp.
220-sams-mal-ftp.internal.sungard.corp X2 WS_FTP Server 6.1.1(45998390)
   This is a private computer system and is restricted to authorized users only. Individuals attempting unauthorized access will be prosecuted. If unauthorized,terminate access now!!
220 sams-mal-ftp.internal.sungard.corp X2 WS_FTP Server 6.1.1(45998390)
---> USER codemove
331 Enter password
---> PASS
230 User logged in
Local directory now /patch_install/get_1667282
---> CWD patch
250 Command CWD succeed
---> TYPE I
200 Transfer mode set to BINARY
Interactive mode off.
---> PORT 170,132,242,9,193,210
---> TYPE A N
---> NLST 3365216_101.tar.Z
---> TYPE I
---> PORT 170,132,242,9,193,211
---> TYPE A N
---> NLST 3367741.1_101.tar.Z
---> TYPE I
---> PORT 170,132,242,9,193,212
---> TYPE A N
---> NLST 3367350_101.tar.Z
---> TYPE I
---> PORT 170,132,242,9,193,213
---> TYPE A N
---> NLST 3362142_101.tar.Z
---> TYPE I
---> PORT 170,132,242,9,193,214
200 Command PORT succeed
---> RETR 3365216_101.tar.Z
125 Downloading in BINARY file 3365216_101.tar.Z (37440821)

exactly this is the information i needed,,,, somehow i am not able to get this info...
What is your OS??? does it have to do anything with it?????

[FONT=monospace]If you are using bash and i guess Ftp_LOG contain a valid filename, you can try

ftp -d -n -v $Remote_Host << EOD &> $Ftp_LOG;

i am using AIX but this code should work on every unix box. check to see if youe ftp command is working without redirecting it to logfile and then redirect it to log.