simple/tcpdump_tools/tcpdump-collect

11 lines
210 B
Bash
Executable File

#!/bin/sh
while true
do
tcpdump -i eth2 -p -e -s 2000 -c 10000 > dump.`isodate`
while [ `du -s . | awk '{print $1}'` -gt 1000000 ]
do
file=`ls -tr dump.????-??-??T??:??:?? | head -1`
rm $file
done
done