Hadoop directories delete older than a month

-bash-4.1$ hdfs dfs -ls -R /data/backup/prd/xyz/ | grep '^d'

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180301

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180302

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180413

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180423

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180501

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180502

drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180505

I Want to delete these date directories like "20180301" from hadoop older than one month

Please suggest on this.

Hello,
discussed a lot of times.

Use find and mtime ..... and exec rm

Have a look at :

Regards

bdittmar gave you the "standard" way to proceed in such case, only if what I see is what I think in your copy/paste of command result, I understand you cannot use the timestamp, is that so?
In which case its more based on the directory name itself, which seems to me quite easy:
Ever thought of using it it as an integer,?
Use the highest value and substract 70 ( a quick guess...) giving the reference value: anything smaller be a candidate for removal...

My 2 cents