Created
May 2, 2017 07:26
-
-
Save AFaust/68a93c1164b09907e896e5ec76c9d073 to your computer and use it in GitHub Desktop.
Alfresco logrotate.d examples - able to handle compress and clear historic timestamped log files
This file contains hidden or 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
/opt/alfresco/tomcat/logs/catalina.out { | |
daily | |
rotate 27 | |
notifempty | |
missingok | |
compress | |
delaycompress | |
copytruncate | |
} | |
/opt/alfresco/tomcat/logs/dummy { | |
rotate 0 | |
daily | |
create | |
ifempty | |
missingok | |
lastaction | |
/usr/bin/find /opt/alfresco/tomcat/logs/localhost_access_log.*.txt.gz -daystart -mtime +26 -delete | |
/usr/bin/find /opt/alfresco/tomcat/logs/alfresco.log.*.gz -daystart -mtime +26 -delete | |
/usr/bin/find /opt/alfresco/tomcat/logs/localhost_access_log.????-??-??.txt -daystart -mtime +1 -exec gzip -q '{}' \; | |
/usr/bin/find /opt/alfresco/tomcat/logs/alfresco.log.????-??-?? -daystart -mtime +1 -exec gzip -q '{}' \; | |
endscript | |
} |
This file contains hidden or 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
/opt/solr/tomcat/logs/catalina.out { | |
daily | |
rotate 27 | |
notifempty | |
missingok | |
compress | |
delaycompress | |
copytruncate | |
} | |
/opt/solr/tomcat/logs/dummy { | |
rotate 0 | |
daily | |
create | |
ifempty | |
missingok | |
lastaction | |
/usr/bin/find /opt/solr/tomcat/logs/localhost_access_log.*.gz.txt -daystart -mtime +26 -delete | |
/usr/bin/find /opt/solr/tomcat/logs/solr.log.*.gz -daystart -mtime +26 -delete | |
/usr/bin/find /opt/solr/tomcat/logs/localhost_access_log.????-??-??.txt -daystart -mtime +1 -exec gzip -q '{}' \; | |
/usr/bin/find /opt/solr/tomcat/logs/solr.log.????-??-?? -daystart -mtime +1 -exec gzip -q '{}' \; | |
endscript | |
} |
Thank you very much for your scripts.
I have Bitnami version of Alfresco (https://bitnami.com/stack/alfresco) and this is the modified version of the script I ended up using:
/opt/alfresco/apache-tomcat/logs/catalina.out {
daily
rotate 27
notifempty
missingok
compress
delaycompress
copytruncate
}
/opt/alfresco/apache-tomcat/logs/dummy {
rotate 0
daily
create
ifempty
missingok
lastaction
/usr/bin/find /opt/alfresco/apache-tomcat/logs/localhost_access_log.*.txt.gz -daystart -mtime +26 -delete
/usr/bin/find /opt/alfresco/apache-tomcat/logs/alfresco.log.*.gz -daystart -mtime +26 -delete
/usr/bin/find /opt/alfresco/apache-tomcat/logs/share.log.*.gz -daystart -mtime +26 -delete
/usr/bin/find /opt/alfresco/apache-tomcat/logs/solr.log.*.gz -daystart -mtime +26 -delete
/usr/bin/find /opt/alfresco/apache-tomcat/logs/catalina.*.log.gz -daystart -mtime +26 -delete
/usr/bin/find /opt/alfresco/apache-tomcat/logs/localhost_access_log.????-??-??.txt -daystart -mtime +1 -exec gzip -q '{}' \;
/usr/bin/find /opt/alfresco/apache-tomcat/logs/alfresco.log.????-??-?? -daystart -mtime +1 -exec gzip -q '{}' \;
/usr/bin/find /opt/alfresco/apache-tomcat/logs/share.log.????-??-?? -daystart -mtime +1 -exec gzip -q '{}' \;
/usr/bin/find /opt/alfresco/apache-tomcat/logs/solr.log.????-??-?? -daystart -mtime +1 -exec gzip -q '{}' \;
/usr/bin/find /opt/alfresco/apache-tomcat/logs/catalina.????-??-??.log -daystart -mtime +1 -exec gzip -q '{}' \;
endscript
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice Ty