Mailscanner maillog SQL auto cleanup script 
#!/usr/local/bin/php
<?php
$host = "localhost";
$user = "mailwatch";
$pass = "";
$db = "mailscanner";
$linkptr = mysql_pconnect ($host,$user,$pass);
mysql_select_db($db,$linkptr);


$DATENOW="-3 MONTH";

$QUERY_DELETE="DELETE FROM maillog WHERE timestamp <= DATE_ADD(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL $DATENOW);";
$QUERY_REPAIR="REPAIR TABLE maillog ";

mysql_query($QUERY_DELETE,$linkptr);
mysql_query($QUERY_REPAIR,$linkptr);

?>


[ 發表回應 ] ( 18預覽 )   |  常註連結  |   ( 3 / 1972 )

<< <前一頁 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 下一頁> >>