diff --git a/.gitignore b/.gitignore index 93a3a831..48ce6e60 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,7 @@ /public/templates/cache/** # Logs -/cronjobs/** -/cronjobs/logs/**.txt +/cronjobs/logs /cronjobs/logs/**.txt.*.gz /logs/* diff --git a/cronjobs/notification_cleanup.php b/cronjobs/notification_cleanup.php new file mode 100755 index 00000000..566b226f --- /dev/null +++ b/cronjobs/notification_cleanup.php @@ -0,0 +1,38 @@ +#!/usr/bin/php +cleanupNotifications($setting->getValue('notifications_cleanup_time', 7))) { + $notification->deleted == 0 ? $log->logDebug('Did not delete any old notifications') : $log->logInfo('Deleted ' . $notification->deleted . ' notifications'); +} else { + $log->logError('Failed to delete notifications: ' . $notification->getCronError()); + $monitoring->endCronjob($cron_name, 'E0074', 0, false, false); +} + +// Cron cleanup and monitoring +require_once('cron_end.inc.php'); +?>