12

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!

Journeyman Geek
  • 133,878
BrianH
  • 783

5 Answers5

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

slhck
  • 235,242
SteveB
  • 33
  • 2
2

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

2

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

For example, revision 1000:

svn ls -vR -r 1000
slhck
  • 235,242
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"}'.
slhck
  • 235,242
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.

MyB
  • 11