Skip to content

Commit

Permalink
Fix the path name of the bistreams log directory
Browse files Browse the repository at this point in the history
Fixed the path name of the dionaea bistreams log files.
  • Loading branch information
Keiichi SHIMA committed Apr 27, 2020
1 parent 99b4701 commit 40c9d19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clean_bistreams.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ CURRENT=$(df / | grep / | awk '{ print $5 }' | sed 's/%//g')
THRESHOLD=95

# Compress bistream files older than 5 minutes
find /opt/dionaea/var/dionaea/bistreams/* -type f -mmin +5 -exec gzip {} \;
find /opt/dionaea/var/lib/dionaea/bistreams/* -type f -mmin +5 -exec gzip {} \;

if [ "${CURRENT}" -gt "${THRESHOLD}" ] ; then
# Clear all bistream logs from dionaea if disk nearly full
find /opt/dionaea/var/dionaea/bistreams/* -type f -exec rm {} \;
find /opt/dionaea/var/lib/dionaea/bistreams/* -type f -exec rm {} \;
else
# Clear bistream logs from dionaea every 60 minutes
find /opt/dionaea/var/dionaea/bistreams/* -type f -mmin +60 -exec rm {} \;
find /opt/dionaea/var/lib/dionaea/bistreams/* -type f -mmin +60 -exec rm {} \;
fi

find /opt/dionaea/var/dionaea/bistreams/* -type d -empty -delete
find /opt/dionaea/var/lib/dionaea/bistreams/* -type d -empty -delete

0 comments on commit 40c9d19

Please sign in to comment.