summarylogtreecommitdiffstats
path: root/snort.logrotate
diff options
context:
space:
mode:
authorAmish2018-04-11 17:23:09 +0530
committerAmish2018-04-11 17:23:09 +0530
commit094878c754bd942a15cb15ffcfdbe4baf88f545c (patch)
tree87447bc5e4ae41ee0fe7310efa7367d6bcf8782e /snort.logrotate
parentad764d168b6202a8b40412f93603ce6a85dcaac7 (diff)
downloadaur-094878c754bd942a15cb15ffcfdbe4baf88f545c.tar.gz
Simplify package building and try to do some cool stuff!
Diffstat (limited to 'snort.logrotate')
-rw-r--r--snort.logrotate19
1 files changed, 19 insertions, 0 deletions
diff --git a/snort.logrotate b/snort.logrotate
new file mode 100644
index 000000000000..ad6fbd2fcae0
--- /dev/null
+++ b/snort.logrotate
@@ -0,0 +1,19 @@
+/var/log/snort/*.log {
+ sharedscripts
+ missingok
+ notifempty
+}
+
+/var/log/snort/alert /var/log/snort/snort.log* /var/log/snort/snort_unified.log* {
+ nocompress
+ nocreate
+ olddir /var/log/snort/old
+ sharedscripts
+ missingok
+ postrotate
+ /usr/bin/find /var/log/snort/old -maxdepth 1 -name 'alert*' -type f -mtime +60 -exec /usr/bin/rm '{}' ';' > /dev/null 2>&1 || true
+ /usr/bin/find /var/log/snort/old -maxdepth 1 -name 'snort.log*' -type f -mtime +60 -exec /usr/bin/rm '{}' ';' > /dev/null 2>&1 || true
+ /usr/bin/find /var/log/snort/old -maxdepth 1 -name 'snort_unified.log*' -type f -mtime +60 -exec /usr/bin/rm '{}' ';' > /dev/null 2>&1 || true
+ /usr/bin/systemctl try-restart snort.service > /dev/null 2>&1 || true
+ endscript
+}