Skip to content

Instantly share code, notes, and snippets.

@kainam00
Created July 31, 2015 14:50
Show Gist options
  • Save kainam00/f9082d25ab5b9016312b to your computer and use it in GitHub Desktop.
Save kainam00/f9082d25ab5b9016312b to your computer and use it in GitHub Desktop.
Truncate tomcat6 logs
#!/usr/bin/ruby
Dir.entries("/var/log/tomcat6").each do |filename|
if filename != "." && filename != ".."
filename = "/var/log/tomcat6/#{filename}"
File.truncate(filename,0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment