hdfs命令参考1-判断文件存在后删除

# clean outputPath

hdfs dfs -test -e $outputPath

if [ $? -eq 0 ]; then

    echo "rm outputPath: $outputPath"

    hdfs dfs -rm -r $outputPath

fi

# not exist and exit 1

hdfs dfs -test -e $inputPath

if [ $? -ne 0 ]; then

exit 1

fi

你可能感兴趣的:(hdfs命令参考1-判断文件存在后删除)