Commit cfd6592f
Changed files (3)
config
recipes
templates
config/recipes/templates/logrotate.erb
@@ -0,0 +1,9 @@
+<%= shared_path %>/log/*.log {
+ daily
+ missingok
+ rotate 52
+ compress
+ delaycompress
+ notifempty
+ copytruncate
+}
config/recipes/logrotate.rb
@@ -0,0 +1,8 @@
+namespace :logrotate do
+ desc "setup logrotate configuration"
+ task :setup do
+ template "logrotate.erb", "/tmp/logrotate_conf"
+ run "#{sudo} mv /tmp/logrotate_conf /etc/logrotate.d/#{application}"
+ end
+ after "deploy:setup", "logrotate:setup"
+end
config/deploy.rb
@@ -10,6 +10,7 @@ load "config/recipes/delayed_job"
#load "config/recipes/rvm"
load "config/recipes/rbenv"
load "config/recipes/monit"
+load "config/recipes/logrotate"
load "config/tasks/utility"
load "config/tasks/rails"