Ethereal-users: RE: [Ethereal-users] Cron job

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "McNutt, Justin M." <McNuttJ@xxxxxxxxxxxx>
Date: Thu, 29 Mar 2001 10:40:51 -0600
Write a wrapper Perl script that does the following:
 
1)  Uses the 'date' function to generate a file name for your capture file.
2)  Forks a second process.
      a)  Parent process simply waits for twenty-four hours, then reaps the
child.
      b)  Child process runs `tethereal -w $file` (or some variation).
 
So each time you run the Perl script, you get a 24-hour capture file.  So
you get cron to call this script every day at 00:01 and you're done.
 
--J

-----Original Message-----
From: Jon Holden-Dye [mailto:jon@xxxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, March 29, 2001 10:19 AM
To: ethereal-users@xxxxxxxxxxxx
Subject: [Ethereal-users] Cron job


Newbie (both Ethereal and Linux) alert ! (I.e. please be gentle...). If you
can suggest a more appropriate list, feel free.
 
I need to capture stuff automatically - generate a new capture file once per
day. I.e. Stop the previous day's capture and Start a new capture. I think I
know how to use crontab to create an entry, but haven't got a clue how to
write a suitable .job file for the crontab entry !
 
I'd like to create the files with the system date forming the first part of
the filename, e.g. 20010329_dbcsup.cap.
 
I'm not sure whether it's best to actually cron-schedule Ethereal itself to
do the captures, or just use tcpdump (for later analysis with Ethereal, of
course). (I need to capture *some* large packets - but think I know how to
tell tcpdump to do that on it's command line - as part of the cron .job
file.)
 
Any kind soul that can help ?
 
TIA, Jon H-D