Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to take a continuous dump file of particular size and after the dump reached it predefined size the new data should overwrite the file.


share|improve this question
So you want to dump to a file until it gets to say 20MB, and then, start dropping the oldest line from the file each time a new line is written? – slm Dec 16 '13 at 7:15
yes @slm that's right – Özzesh Dec 16 '13 at 8:29

I think your options, without the -G switch of tcpdump are limited to the method discussed in this U&L Q&A titled: Keep log file size fixed without logrotate.

The issue you're going to run into is, that with the alternative methods, a kill -HUP ... will need to be sent to tcpdump to signal it that the file's been moved/removed,

I'm not sure tcpdump is up to doing this, so I think your best option is to get a version of tcpdump on the box with this feature, IMO

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.