11

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!

5 Answers 5

1

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

1
  • Easy to follow answer, but near impossible in corporate settings.
    – user486359
    Oct 24, 2022 at 8:08
3

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

2

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

For example, revision 1000:

svn ls -vR -r 1000
1

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"}'.
1

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.

You must log in to answer this question.

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