Skip to content

Instantly share code, notes, and snippets.

@krzkrzkrz
Last active October 11, 2016 02:11
Show Gist options
  • Save krzkrzkrz/5a455213a96abf4f7a234c9682d448c5 to your computer and use it in GitHub Desktop.
Save krzkrzkrz/5a455213a96abf4f7a234c9682d448c5 to your computer and use it in GitHub Desktop.
<%#
Based out of the opsworks template located at:
https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.10/deploy/templates/default/logrotate.erb
We want to limit the daily log file size to 100mb, so that it does not consume the servers disk space over time
%>
<% @log_dirs.each do |dir| %><%= dir %>/*.log <% end %> {
size 50M
missingok
rotate <%= node[:logrotate][:rotate] %>
compress
delaycompress
notifempty
copytruncate
sharedscripts
<% if (node[:platform] == 'ubuntu' && node[:platform_version] == '14.04') || rhel7? -%>
su root root
<% end -%>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment