File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
server/lib/classes/cron.d Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,18 @@ public function onRunJob() {
240240 */
241241 $ sql = "DELETE FROM sys_log WHERE tstamp < ? AND server_id != 0 " ;
242242 $ app ->dbmaster ->query ($ sql , $ tstamp );
243+
244+ /*
245+ * now delete those entries without a linked datalog entry (datalog_id = 0)
246+ */
247+ $ sql = "DELETE FROM sys_log WHERE tstamp < ? AND server_id = 0 AND datalog_id = 0 " ;
248+ $ app ->dbmaster ->query ($ sql , $ tstamp );
249+
250+ /*
251+ * now delete those entries with a linked datalog entry (datalog_id != 0) only if older than 30 days
252+ */
253+ $ sql = "DELETE FROM sys_log WHERE tstamp < ? AND server_id = 0 AND datalog_id != 0 " ;
254+ $ app ->dbmaster ->query ($ sql , $ tstamp - (3600 * 24 * 23 ));
243255
244256 /*
245257 * Delete all remote-actions "done" and older than 7 days
You can’t perform that action at this time.
0 commit comments