Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

deny rm with skiptrash

avatar
Rising Star

How to denied use rm with -skiptrash on HDFS?


I want to block any attempts to delete a file with the -skiptrash option.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@Ruslan Fialkovsky You need to write a custom code which can block -skiptrash command


This is the path where you need to place the command


vi /usr/hdp/current/hadoop-client/bin/hadoop
#!/bin/bash

export HADOOP_HOME=${HADOOP_HOME:-/usr/hdp/2.6.5.0-292/hadoop}
export HADOOP_MAPRED_HOME=${HADOOP_MAPRED_HOME:-/usr/hdp/2.6.5.0-292/hadoop-mapreduce}
export HADOOP_YARN_HOME=${HADOOP_YARN_HOME:-/usr/hdp/2.6.5.0-292/hadoop-yarn}
export HADOOP_LIBEXEC_DIR=${HADOOP_HOME}/libexec
export HDP_VERSION=${HDP_VERSION:-2.6.5.0-292}
export HADOOP_OPTS="${HADOOP_OPTS} -Dhdp.version=${HDP_VERSION}"

exec /usr/hdp/2.6.5.0-292//hadoop/bin/hadoop.distro "$@"

###here you need to write code to restrict skip trash

View solution in original post

1 REPLY 1

avatar
Super Collaborator

@Ruslan Fialkovsky You need to write a custom code which can block -skiptrash command


This is the path where you need to place the command


vi /usr/hdp/current/hadoop-client/bin/hadoop
#!/bin/bash

export HADOOP_HOME=${HADOOP_HOME:-/usr/hdp/2.6.5.0-292/hadoop}
export HADOOP_MAPRED_HOME=${HADOOP_MAPRED_HOME:-/usr/hdp/2.6.5.0-292/hadoop-mapreduce}
export HADOOP_YARN_HOME=${HADOOP_YARN_HOME:-/usr/hdp/2.6.5.0-292/hadoop-yarn}
export HADOOP_LIBEXEC_DIR=${HADOOP_HOME}/libexec
export HDP_VERSION=${HDP_VERSION:-2.6.5.0-292}
export HADOOP_OPTS="${HADOOP_OPTS} -Dhdp.version=${HDP_VERSION}"

exec /usr/hdp/2.6.5.0-292//hadoop/bin/hadoop.distro "$@"

###here you need to write code to restrict skip trash