Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to know how much disk space each project in a SubVersion repository is using?

I can check out a working copy of each project and look at the size each project takes up, but I don't think that encompasses the total size of the project (all revisions).

I can look under the "db" directory of the repository, but none of the files in there make sense - I don't think it is possible to use them to figure out how much space each project occupies.

I tried the svn ls --verbose command, but the size that it gives me is just the size of the actual files in the head revision, I don't think it includes all revisions.

Maybe this isn't possible, but I thought I would ask.

Thanks in advance!

share|improve this question
up vote 0 down vote accepted

The only thing that comes into my mind is this:

  • create a temporary new empty repository

  • svnadmin dump the old repository, filter it to retain just a single project with svndumpfilter, and import it into the new repository

  • look at the size of the new repository, then delete it

share|improve this answer

If you use the -r option, you can specify a revision.

For example, revision 1000:

svn ls -vR -r 1000
share|improve this answer

I used this recently but changed it slightly to be more accurate

svn list -vR svn://server/repo/somedir | awk '{tmp=match($3,/[0-9]/);if(tmp){sum+=$3; i++}} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'

I used

{tmp=match($3,/[0-9]/) 

instead of if

($3 !="")

as it gives a more accurate file count

share|improve this answer

If you have access to the server terminal you can use du (disk used):

du -sh /var/svn-repos/project-doomsday

that gives you the total amount of space used by that repo on the server, including the usually small database.

share|improve this answer

Size of the repository can be found using the following command ..

Though this doesn't produce the exact results all the time, I found this to be helpful most of the times.

svn list -vR svn://server/repo/somedir | awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .