summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog
diff options
context:
space:
mode:
authorSimon Rettberg2016-08-22 12:11:27 +0200
committerSimon Rettberg2016-08-22 12:11:27 +0200
commitf2133e98aa5457f99e4ab7e8f8ac48b9720fb777 (patch)
tree734c3b47b99bdb711f5abce76e130c34d84f3bbd /modules-available/syslog
parentMerge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into mo... (diff)
downloadslx-admin-f2133e98aa5457f99e4ab7e8f8ac48b9720fb777.tar.gz
slx-admin-f2133e98aa5457f99e4ab7e8f8ac48b9720fb777.tar.xz
slx-admin-f2133e98aa5457f99e4ab7e8f8ac48b9720fb777.zip
Modularize cron api
Modules now can have a ./hooks/cron.inc.php to run every X minutes, according to how you set up the cron job for the global /inc/cron.inc.php
Diffstat (limited to 'modules-available/syslog')
-rw-r--r--modules-available/syslog/hooks/cron.inc.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules-available/syslog/hooks/cron.inc.php b/modules-available/syslog/hooks/cron.inc.php
new file mode 100644
index 00000000..c796675f
--- /dev/null
+++ b/modules-available/syslog/hooks/cron.inc.php
@@ -0,0 +1,5 @@
+<?php
+
+if (mt_rand(1, 10) === 1) {
+ Database::exec("DELETE FROM clientlog WHERE (UNIX_TIMESTAMP() - dateline) > 86400 * 190");
+} \ No newline at end of file