-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup script doesn't cover bro's extracted directory #9
Comments
replacement for will create pull request later
|
I have set 45000000 as free space to force the cleanup script, I tried but I think it does not work properly
I was thinking to do something like this and assing a max size for pcap and extracted #!/bin/sh
TopSizePCAP=25000000
TopSizeExtract=2500000
removePcap() {
local usedPCAP
usedPCAP=`du /nsm/pcap/ | awk '{ print $1 }'`
while [ ${usedPCAP} -gt ${TopSizePCAP} ]; do
find /nsm/pcap -type f -printf '%T+ %p\n' | sort | head -n1 | awk '{print $2}' | xargs rm -v
usedPCAP=`du /nsm/pcap/ | awk '{ print $1 }'`
done
}
removeExtracted() {
local usedExtracted
usedExtracted=`du /nsm/bro/extracted/ | awk '{ print $1 }'`
while [ ${usedExtracted} -gt ${TopSizeExtract} ]; do
find /nsm/bro/extracted -type f -printf '%T+ %p\n' | sort | head -n1 | awk '{print $2}' | xargs rm -v
usedExtracted=`du /nsm/bro/extracted/ | awk '{ print $1 }'`
done
}
removePcap
removeExtracted
exit 0 What do you think? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fix will be provided shortly, issue will be updated accordingly
The text was updated successfully, but these errors were encountered: