This file contains hidden or 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
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Author: Avishai Ish-Shalom <[email protected]> | |
# We need to specify GNU sed for OS X, BSDs, etc. | |
if [[ "$(uname -s)" == "Darwin" ]]; then | |
SED=gsed | |
else | |
SED=sed | |
fi |
This file contains hidden or 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 "date" | |
five_days_ago = Date.parse(Time.now.to_s) - 5 | |
IO.popen("hadoop fs -lsr /tmp").each_line do |line| | |
permissions,replication,user,group,size,mod_date,mod_time,path = *line.split(/\s+/) | |
if (mod_date) | |
if Date.parse(mod_date.to_s) < five_days_ago | |
puts line | |
if permissions.split('')[0] == 'd' |
NewerOlder