archive ftp logs

include("/etc/function.php");

compresslog();

?>


FUNCTIONS


error_reporting(E_ALL);


//*********************************************************************************************************************

// COMPRESSLOG

//*********************************************************************************************************************

function compresslog() {


include("/etc/tar.php");

$logfile_list = "/var/log/vsftpd.log";

$filename = "/var/log/vsftpd/logarchive" . date("YmdHis") . ".tar.gz";

$tar_object = new Archive_Tar($filename, true);

$tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling

$tar_object->createModify($logfile_list, "");

if(!unlink($logfile_list)) {

echo "A problem was encountered attempting to delete $logfile_list .";

}

}


?>