Created
June 22, 2011 18:23
-
-
Save kimsterv/1040741 to your computer and use it in GitHub Desktop.
Clean bad gzips
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
#!/bin/bash | |
for i in `hadoop fs -lsr /flume/incoming/2011/04 | awk '{print $8}'`; do | |
echo $i; hadoop fs -cat $i | gzip -t | |
if [ $? -ne 0 ] && [ -n "`echo \"$i\" | grep 'gz$'`" ]; then | |
`echo hadoop fs -rmr -skipTrash $i` | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment