Created
August 27, 2010 18:30
-
-
Save kovyrin/553915 to your computer and use it in GitHub Desktop.
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 | |
require 'fileutils' | |
Dir.chdir("/var/log/hadoop/userlogs") do | |
Dir.glob("attempt_2*") do |dir| | |
next unless File.readlines("#{dir}/syslog").last.match(/Task.*done/) | |
FileUtils.rm_rf("/var/log/hadoop/userlogs/#{dir}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment