Created
October 26, 2018 14:38
-
-
Save fxpires/90b0ce0e31d10cd1987bf3cdca32d08a to your computer and use it in GitHub Desktop.
JBoss/Wildfly Log compression. Compress both server.log and access_log (if exists). Ignores already compressed logs in gz or xz formats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Server log compression | |
find /opt/jboss/standalone/log -maxdepth 1 -type f -name 'server.log.*' -not -name '*xz' -not -name '*gz' -exec xz -3 {} \; | |
# default-host log compression | |
test -d /opt/jboss/standalone/log/default-host && find /opt/jboss/standalone/log/default-host -type f -mtime +0 -not -name '*xz' -exec xz -3 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment