LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-07-2012, 07:22 AM   #1
omega341991
Member
 
Registered: May 2012
Posts: 39

Rep: Reputation: Disabled
how to kill tcpdump execution after data transmission is complete?


how can i kill(stop) a tcpdump capture after a test device transmitting the data has stopped trasnmission?
i cannot specify the count as

tcpdump -c 1000

i dont want it this way

suppose that a device is transmitting 1000 packets, i want to stop the capture process after the transmission of the 1000 packets is complete and as i said before i dont want to limit the capture process at the tcpdump capture


awaiting reply
 
Old 06-07-2012, 07:46 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you kill the process somehow. You know when the transfer is complete right? So just pkill the tcpdump process as the next line in a wrapper script or some such.
 
Old 06-08-2012, 12:20 AM   #3
omega341991
Member
 
Registered: May 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
i dont know when the transfer is complete. That is the problem. Earlier i used a "timeout " to kill the process, but i found that it is not efficient at all. hence i am lookin for some other way to stop the dump process. Can i kill the process if no packets are received?
The tcpdump goes idle when there is no data reception. So can i use this aspect somehow to kill the dump process?

Please reply
 
Old 06-08-2012, 01:52 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
not within tcpdump itself, no. you could look at the size or age of the capture file though maybe. offhand I can't recall if a file that's still open would have its creation dates changed. but either of those angles would let you loop around until something about the output file is seen to be static, suggesting an end to the transfer.
 
  


Reply



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
[SOLVED] On Re-Boot Transmission Can't See the Data (Error: No Data Found) rrsc16954 Linux - Hardware 1 07-29-2012 10:41 AM
Data Packet Transmission in a LAN JULIUSTOTHEBEST Linux - Networking 2 06-25-2011 07:41 AM
[SOLVED] Serial port : Read data problem, not reading complete data anujmehta Linux - Networking 5 09-06-2010 06:10 AM
Secure data transmission introuble Programming 10 04-27-2007 02:31 AM
Data Rate transmission discrepancy suggesting hijack drmjh Linux - Security 13 03-23-2007 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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