Capturing FTP logs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Capturing FTP logs
# 1  
Old 05-02-2011
Capturing FTP logs

Hi Guys,

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

I am using the below code.

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!!!!
# 2  
Old 05-02-2011
did you try this -
Code:
ftp -d -n -v $Remote_Host << EOD | tee -a $Ftp_LOG;


Last edited by Franklin52; 05-02-2011 at 09:22 AM.. Reason: Please use code tags, thank you
# 3  
Old 05-02-2011
Yes i tried using tee also.. It did not work too...
Can somebody help me out here..
Thanks in advance..
# 4  
Old 05-02-2011
Shouldn't it be with 2>&1 ?
# 5  
Old 05-02-2011
you get limited info redirected in log when you use -d option. i am getting logs for below code -

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


Code:
/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)


Last edited by pludi; 05-02-2011 at 06:15 PM..
# 6  
Old 05-02-2011
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?????
# 7  
Old 05-02-2011
If you are using bash and i guess Ftp_LOG contain a valid filename, you can try

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


Last edited by Chirel; 05-02-2011 at 03:37 PM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. Shell Programming and Scripting

Shell script for capturing FTP logs

I have a script #!/bin/bash HOST=ftp.example.com USER=ftpuser PASSWORD=P@ssw0rd ftp -inv $HOST <<EOF user $USER $PASSWORD cd /path/to/file mput *.html bye EOF the script executes sucessfully I need to capture the FTP logs to a logfile should contain FTP Login successful ... (1 Reply)
Discussion started by: rajeshas83
1 Replies

3. UNIX for Beginners Questions & Answers

Help with Capturing time from Autosys logs

Hi Guys, I'm very new to Shell scripting and have to design a code which I'm not able to find a way to. I will try to explain the aim in detail and shall be obliged if anyone could help me with the coding snippet. I have an input file who's every row has a few details about an autosys Job. I shall... (1 Reply)
Discussion started by: Crusnik02
1 Replies

4. Shell Programming and Scripting

Help in capturing Time from Autosys Logs

Hi Guys, I'm very new to Shell scripting and have to design a code which I'm not able to find a way to. I will try to explain the aim in detail and shall be obliged if anyone could help me with the coding snippet. I have an input file who's every row has a few details about an autosys Job. I shall... (0 Replies)
Discussion started by: Crusnik02
0 Replies

5. Shell Programming and Scripting

Capturing the killed process logs

I have two set of questions. 1) To skip killing some process automatically. 2) To kill other process and capture their log. I have set of process, some needs to be killed gracefully and others should be skipped. Listed are the process. adm 1522... (1 Reply)
Discussion started by: murali1687
1 Replies

6. Emergency UNIX and Linux Support

Capturing console (/dev/ttyS1) logs

Hi, I have been trying to capture console logs from the init script. When the ramfs is mounted, i check if usb is connected , if conncted, i mount it and redirected the console logs like so: cat & /dev/ttyS1 >> /mnt/logs.txt I'm getting /bin/sh : /dev/ttyS1 :permission denied ... (8 Replies)
Discussion started by: xerox
8 Replies

7. UNIX for Advanced & Expert Users

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (4 Replies)
Discussion started by: manisendhil
4 Replies

8. UNIX for Dummies Questions & Answers

Capturing FTP log

I am trying to do the FTP using .netrc.In my .netrc file in $HOME dir i am placing the machine ip,user name and pwd.Then i am creating dynamically a file which contains the ftp commands. My script is like below: __________________________________ export REMOTE_DIR= <some path> export... (4 Replies)
Discussion started by: dr46014
4 Replies

9. UNIX for Dummies Questions & Answers

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (2 Replies)
Discussion started by: manisendhil
2 Replies

10. UNIX for Advanced & Expert Users

Capturing failed FTP error

Hi All, Please check the below ftp related job, which is deleting the files from remote host. Problem is it is not capturing the ftp failure error, and the exit status is still '0' eventhough the deletable files are not present in remote location OR ftp credential are incorrect. ... (5 Replies)
Discussion started by: ganapati
5 Replies
Login or Register to Ask a Question