Snort mailing list archives
Re: For those of you
From: Max Valdez <maxvalde () fis unam mx>
Date: Tue, 27 Jul 2004 13:13:19 -0500
What about this ??
I havent look at the tables design carefully, but I have this proposal.
maybe i should set where cid='$row->cid' or sid='$row->sid' ??
Coments accepted
Max
--------
#!/bin/php -q
<?php
//define mysql connection settings
define('HOST', 'localhost');
define('USER', 'user');
define('PASS', 'password');
define('DB', 'dbname');
mysql_connect(HOST, USER, PASS)
or die("Couldnt connect to database");
mysql_select_db(DB)
or die("Couldnt select database");
$select =mysql_query("SELECT cid FROM event WHERE timestamp
<CURRENT_DATE() - INTERVAL 30 DAY")
or die(mysql_error());
$rows=0;
while($row=mysql_fetch_object($select) {
$delete=mysql_query("DELETE FROM acid_event where
cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
$delete=mysql_query("DELETE FROM data where cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
$delete=mysql_query("DELETE FROM iphdr where cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
$delete=mysql_query("DELETE FROM opt where cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
$delete=mysql_query("DELETE FROM tcphdr where
cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
$delete=mysql_query("DELETE FROM udphdr where
cid='$row->cid'";
$qrows=mysql_fetch_row($delete);
$rows = $rows + $qrows;
}
//This delete query will purge all logs that are older than 30 days
$delete = mysql_query("DELETE FROM event WHERE timestamp <
CURRENT_DATE() - INTERVAL 30 DAY")
or die(mysql_error());
?>
------------
--
Linux garaged 2.6.7-rc3-mm2 #2 Sat Jun 19 15:43:32 CDT 2004 i686 Intel(R)
Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GS/S d- s: a-29 C++(+++) ULAHI+++ P+ L++>+++ E--- W++ N* o-- K- w++++ O- M--
V-- PS+ PE Y-- PGP++ t- 5- X+ R tv++ b+ DI+++ D- G++ e++ h+ r+ z**
------END GEEK CODE BLOCK------
gpg-key: http://garaged.homeip.net/gpg-key.txt
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users
Current thread:
- For those of you Esler, Joel - Contractor (Jul 27)
- Re: For those of you sekure (Jul 27)
- Re: For those of you Max Valdez (Jul 27)
- <Possible follow-ups>
- RE: For those of you Esler, Joel - Contractor (Jul 27)
- RE: For those of you John Creegan (Jul 27)
- Re: For those of you sekure (Jul 27)
