Skip to content

Instantly share code, notes, and snippets.

@3dd13
Created January 27, 2011 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3dd13/798157 to your computer and use it in GitHub Desktop.
Save 3dd13/798157 to your computer and use it in GitHub Desktop.
Adding log purging job using chef
cron "housekeep application log files" do
user "housekeeper"
# mailto "your@example.com"
# 00:01 every night
hour "0"
minute "1"
# clean up logs older than 30 days
command "/find ~/log/application-*.log.tar.gz -mtime +30 -exec rm {} \;"
end
# we need cron for scheduler
package cron do
action :install
end
include_recipe "housekeep::clear_log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment