weixin_39614528 2020-11-30 15:34
浏览 0

[Patch] Adds timed dump file rotations

Converted from SourceForge issue 1066046, submitted by madwilli

This patch adds the -G |rotate_seconds| flag. The man page and usage() have been update appropriately.

Basically, this adds a flag which specifies how often to stop writing to the current dump file, and create a new one.

For example:

tcpdump -w /tmp/timed_dumps. -G 10

yields

/tmp/timed_dumps.1100413473 /tmp/timed_dumps.1100413483 /tmp/timed_dumps.1100413493 ...

It can be used in conjunction with the -C and -W flags as well. When used with the -C flag and no -W, the patch forces the addition of a 0 for sanity's sake. This can be removed if desired for consistency. The patch also forces a '.' after the time so that sorting isn't broken.

MakeFilename now takes a pointer to a pointer which it allocates for storing the name.

When -W is specified, the number of files created is limited to CFLAG_MAX, otherwise, it will continue to make new files indefinitely.

Other notes:

I could not login to anoncvs, so this is patched against yesterday's release.

Please let me know what should change, etc.

Thanks!

该提问来源于开源项目:the-tcpdump-group/tcpdump

  • 写回答

8条回答 默认 最新

  • weixin_39614528 2020-11-30 15:34
    关注

    Submitted by madwilli

    Logged In: YES user_id=131442

    The usage ran over 80 characters, here's a second patch to apply after the first one that corrects that. Sorry!

    评论

报告相同问题?