设定hdfs回收站: 设定hdfs回收站的数据保留1440分钟,即1天(1*24*60).
vi core-site.xml 文件的内容:
<property>
<name>fs.trash.interval</name>
<value>1440</value>
<description>Number of minutes between trash checkpoints.
If zero, the trash feature is disabled.
</description>
</property>
$ hadoop dfs -rmr /python 删除python目录
恢复刚刚删除的目录/python :
vi core-site.xml 文件的内容:
<property>
<name>fs.trash.interval</name>
<value>1440</value>
<description>Number of minutes between trash checkpoints.
If zero, the trash feature is disabled.
</description>
</property>
$ hadoop dfs -rmr /python 删除python目录
恢复刚刚删除的目录/python :
hadoop dfs -mv /user/hadoop/.Trash/Current/python /python