Sha256: a472b255248ecadcd0048bcce60daa81bb15621835546c215e291228f31381e4

Contents?: true

Size: 839 Bytes

Versions: 15

Compression:

Stored size: 839 Bytes

Contents

#!/usr/bin/env bash

#
# Documentation for hadoop fs -rmr says "acts just like Unix rm -rf command". If this
# is true then we need to ignore directories that don't exist and still return 0.
#

#
# All the dirty conditional logic here does is test whether a directory exists. If so, remove it
#
if [ "$1" == "-r" ] ; then
  shift
  if [ "$1" == "-skipTrash" ] ; then
    shift
    hadoop fs -test -e "$@"
    if [ "$?" == "0" ] ; then
      # echo "File exists, skipping trash, removing it..."
      echo hadoop dfs -rmr -skipTrash "$@"
      exec hadoop dfs -rmr -skipTrash "$@"
    fi
  else
    hadoop fs -test -e "$@"
    if [ "$?" == "0" ] ; then
            # echo "File exists, removing it..."
      echo hadoop dfs -rmr "$@"
      exec hadoop dfs -rmr "$@"
    fi
  fi
else
  echo hadoop dfs -rm "$@"
  exec hadoop dfs -rm "$@"
fi

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
wukong-hadoop-0.2.0 bin/hdp-rm
wukong-hadoop-0.1.1 bin/hdp-rm
wukong-hadoop-0.1.0 bin/hdp-rm
wukong-hadoop-0.0.2 bin/hdp-rm
wukong-hadoop-0.0.1 bin/hdp-rm
wukong-3.0.0.pre bin/hdp-rm
wukong-2.0.2 bin/hdp-rm
wukong-2.0.1 bin/hdp-rm
wukong-2.0.0 bin/hdp-rm
wukong-1.5.4 bin/hdp-rm
wukong-1.5.3 bin/hdp-rm
wukong-1.5.2 bin/hdp-rm
wukong-1.5.1 bin/hdp-rm
wukong-1.5.0 bin/hdp-rm
wukong-1.4.12 bin/hdp-rm