becustom
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/joyplace/public_html/wp-includes/functions.php on line 6114wordpress-seo
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/joyplace/public_html/wp-includes/functions.php on line 6114Cleaning up older or obsolete files in HDFS is important. Even if you have a big enough cluster with lot of space, if you don\u2019t have good clean up scripts to keep your cluster clean, little things add up and before you know you will run out of space in your cluster.<\/span><\/p>\n HDFS does not have a command out of the box to list all the directories that are N days old. But you can write a simple script to do so.<\/span><\/p>\n Here is a small script to list directories older than 10 days.<\/span><\/p>\n hadoop fs -ls -R command list all the files and directories in HDFS. grep “^d” will get you only the directories. Then with while..do let\u2019s loop through each directory.<\/p>\n awk ‘{print $6}’<\/span>\u00a0 gets the date of the directory and save it in dir_date.<\/span><\/p>\n Below script calculate the difference between the date from the directory and the current date and convert the difference to the number of days.<\/span><\/p>\n Finally print the directory if the difference is more than 10 days.<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" How to find directories in HDFS which are older than N days? Cleaning up older or obsolete files in HDFS is important. Even if you have [\u2026]<\/span><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1142","post","type-post","status-publish","format-standard","hentry","category-hadoop"],"yoast_head":"\nScript<\/h2>\n
now=$(date +%s)\r\nhadoop fs -ls -R | grep \"^d\" | while read f; do\r\n\u00a0dir_date=`echo $f | awk '{print $6}'`\r\n\u00a0difference=$(( ( $now - $(date -d \"$dir_date\" +%s) ) \/ (24 * 60 * 60 ) ))\r\n\u00a0if [ $difference -gt 10 ]; then\r\n\u00a0\u00a0\u00a0echo $f;\r\n\u00a0fi\r\ndone<\/pre>\n
hadoop fs -ls -R | grep \"^d\" | while read f; do<\/pre>\n
dir_date=`echo $f | awk '{print $6}'`<\/pre>\n
difference=$(( ( $now - $(date -d \"$dir_date\" +%s) ) \/ (24 * 60 * 60 ) ))<\/pre>\n
\u00a0if [ $difference -gt 10 ]; then\r\n\u00a0\u00a0\u00a0echo $f;\r\n\u00a0fi<\/pre>\n