Skip to content

Instantly share code, notes, and snippets.

@hiroki-uchida
Last active October 19, 2017 09:38
Show Gist options
  • Save hiroki-uchida/f387ad0192a45eb7ffe9a26e161088d4 to your computer and use it in GitHub Desktop.
Save hiroki-uchida/f387ad0192a45eb7ffe9a26e161088d4 to your computer and use it in GitHub Desktop.
itamae cookbook logrotate examples.
# cookbooks/logrotate/default.rb
package 'crontabs'
package 'logrotate'
service 'crond' do
action %i[start enable]
end
file '/etc/logrotate.d/rails'
# cookbooks/logrotate/files/etc/logrotate.d/rails
/var/apps/rails-app/shared/log/*log {
create 0644 ruby ruby
daily
rotate 365
missingok
notifempty
copytruncate
compress
sharedscripts
postrotate
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment