D
D
Dmitry2017-11-07 06:42:03
bash
Dmitry, 2017-11-07 06:42:03

How to run tcpdump in the background?

Hello. It is required to record some packets of network traffic. In general, I see it like this:
If there is a running tcpdump process from the last iteration, terminate it.
Start a new tcpdump process and write the traffic to a file.

A number of questions arose: how to terminate a specific tcpdump process started yesterday?
How to run tcpdump in the background ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Stepanov, 2017-11-07
@leoykt

why exactly tcpdump? If there is a task to sniff packages (one libpcap fig), daemonize, and write to a file, use this garbage: https://github.com/Cisco-Talos/Daemonlogger

J
jcmvbkbc, 2017-11-07
@jcmvbkbc

A number of questions arose: how to terminate a specific tcpdump process started yesterday?

Just after running tcpdump yesterday send its PID to a file. Today, read the contents of this file and kill the process with this number if it is still tcpdump.
tcpdump <опции> >& /dev/null &

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question