AnsweredAssumed Answered

How to check the size of a directory?

Question asked by matthew_moisen on Sep 12, 2016
Latest reply on Nov 4, 2016 by aalvarez

Hi MapR Team,

 

I would like to build a script that can track the change of usage over time in my volume, with granularity down to the directories.

 

I know that I can execute `du -sh /hdfs/app/myvolume/mydirectory`. However, this incorrectly assumes that a MapR Table inside of that directory is 512 bytes. I know that I can also execute `maprcli table info -path /app/myvolume/mydirectory/mytable -json` to pull the MapR Table size. However with this, I will need to build a script that checks each entry in each directory to determine if it is a MapR table.

 

Is there a one line command that returns the true size of a given directory in MapR, which is inclusive of the M7 tables?

 

Thanks and best regards,

 

Matthew

Outcomes