Is there a smart way of deleting old files from the hdfs /tmp directory? (Just to make sure, I am not talking about the unix FS /tmp)
Deleting temp directory from HDFS
hadoophdfs
hadoophdfs
Is there a smart way of deleting old files from the hdfs /tmp directory? (Just to make sure, I am not talking about the unix FS /tmp)
Best Answer
hadoop fs -stat "%Y" "/path/*"
Will output timestamps of everything in /path/. Use that along with a cut off as to what you consider too young and you can have this clean up in a shell script kicked off by cron.This might be smarter then parsing other things outputted by hadoop fs.