mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
Updated dail schedule to remove old syslog and eventlog entries
This commit is contained in:
@@ -7,9 +7,26 @@
|
||||
|
||||
include('includes/defaults.inc.php');
|
||||
include('config.php');
|
||||
include_once("includes/definitions.inc.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
$options = getopt("f:");
|
||||
|
||||
if ( $options['f'] === 'update') { echo $config['update']; }
|
||||
|
||||
if ( $options['f'] === 'syslog') {
|
||||
if ( is_numeric($config['syslog_purge'])) {
|
||||
if ( dbDelete('syslog', "timestamp < DATE_SUB(NOW(), INTERVAL ? DAY)", array($config['syslog_purge'])) ) {
|
||||
echo 'Syslog cleared for entries over ' . $config['syslog_purge'] . " days\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $options['f'] === 'eventlog') {
|
||||
if ( is_numeric($config['eventlog_purge'])) {
|
||||
if ( dbDelete('eventlog', "datetime < DATE_SUB(NOW(), INTERVAL ? DAY)", array($config['eventlog_purge'])) ) {
|
||||
echo 'Eventlog cleared for entries over ' . $config['eventlog_purge'] . " days\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user