I'm not sure if this feature exists already wrapped or provided as a recipe for users or not yet. But it would be nice to be able to do a

git annex du [PATH]

Such that the output that git annex would return is the total disk used locally in the PATH and the theoretical disk used by the PATH if it was fully populated locally. e.g.

$ git annex du FSL0001_ANALYSIS
$ Local: 1000kb, Annex: 2000kb

or something along the lines of that?

Use du -L for the disk space used locally. The other number is not currently available, but it would be nice to have. I also sometimes would like to have data on which backends are used how much, so making this git annex status --subdir is tempting. Unfortunatly, it's current implementation scans .git/annex/objects and not the disk tree (better for accurate numbers due to copies), so it would not be a very easy thing to add. Not massively hard, but not something I can pound out before I start work today..

Comment by http://joeyh.name/ Wed Jun 27 12:36:08 2012

I have a hacked up version of sharebox that does this.. I need to fix it up and push it to github..

the short of it is that you can do

def calculate_size(path):
    annexfile = os.path.basename(os.readlink(path))
    #SHA256-s2007550713--....
    size = annexfile.split("-")[1]
    return int(size[1:])

to get the size of files.. a 'git-annex du' should be pretty straightforward...

Comments on this page are closed.