#! /bin/bash
tmpfile=`date '+%Y%m%d%H%M%S'`.txt
echo $tmpfile
for i in `find /home/hadoop/tmp/log -name localhost*`
do
echo $i
if [ -s $i ]
then
cat $i >> $tmpfile
rm -f $i
fi
done
if [ -s $tmpfile ]
then
bin/hadoop fs -put $tmpfile /input
rm $tmpfile
bin/hadoop fs -rmr /output
bin/hadoop jar count.jar org.daidai.mr.WordCount /input /output
bin/hadoop fs -rm /input/*
fi
count.sh
最新推荐文章于 2022-09-20 18:18:35 发布