Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-21-2011, 01:12 PM   #1
LQ Newbie
Registered: Apr 2011
Posts: 3

Rep: Reputation: 0
How to capture Net::FTP session log to a file ?

hi all, can anybody show me how to capture the FTP session output from Net::FTP module to a text file or in a variable ?
Old 04-21-2011, 01:36 PM   #2
LQ Newbie
Registered: Apr 2011
Posts: 16

Rep: Reputation: 3
Originally Posted by aullah View Post
hi all, can anybody show me how to capture the FTP session output from Net::FTP module to a text file or in a variable ?
Use something like tcpdump to sniff all ftp traffic.
I think something like this will work (change 'eth0' to the name of the network interface that you're using):
tcpdump -i eth0 '(port ftp or ftp-data)' -w outputfile.cap
Of course if you have more than just that perl script using the ftp protocol you'll sniff some extra stuff you don't want. If you're only doing this once it'd be easier to just read the tcpdump man and make sure it'll filter by destination/src IP or something that identifies the specific session you want. You could also install an ftp proxy with logging capabilities and tell Net:FTP to go though it with the ftp_firewall attribute.

Last edited by poorsod; 04-21-2011 at 01:49 PM. Reason: close paranthesis


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a program that logs all net traffic to a log file manti111 Linux - General 8 08-14-2009 07:34 AM
Recieving a blank file during ftp session mrobertson Programming 4 07-06-2005 02:31 PM
ftp large file - lose net connect red hat 6 steve2k Linux - Networking 0 03-10-2004 11:28 AM
Log file for ftp scialom Linux - Software 1 08-11-2003 10:54 AM
perl, Net::Ftp, and Novell file modification time neo77777 Programming 0 01-30-2003 10:41 PM

All times are GMT -5. The time now is 02:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration