Created
April 27, 2011 13:57
-
-
Save severin/944286 to your computer and use it in GitHub Desktop.
Rails Log Cleaner
This file contains 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
#!/usr/bin/env ruby | |
logfiles = Dir["#{ENV['HOME']}/**/app/../log/*.log"] # any file with a .log extension in a log directory besides an app directory... | |
logfiles.each {|file| system "echo '' > #{file}"} | |
puts "Cleaned #{logfiles.size} logs..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment