判断hdfs文件是否存在

#!/bin/bash
HADOOP=$(which hadoop)
$HADOOP fs -test -e $1
if [ $? -eq 1 ]
then
$HADOOP fs -put $1 /
if [ $? -eq 0 ]
then
echo "the file $1 put successfully!"
fi
fi

猜你喜欢

转载自www.cnblogs.com/pingzizhuanshu/p/8995455.html
今日推荐