[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Limit size of the repository

From: Dominic Anello <danello_at_danky.com>
Date: 2004-10-11 16:25:53 CEST

On 2004-10-10 23:46:24 +0200, Stef wrote:
> Hello,
>
> I would like host some svn repositories, but I want limit their size.
> How to do that ?
>
> Thanks.
>
> Stéphane

One way to do that is to check the current repository size before a
commit and reject it if the repo is to big. Here's a very simple
pre-commit hook script that shows the idea:

------------------------------------------------------------------------
#!/bin/sh

umask 002

repo=$1
txn=$2
PATH='/usr/bin:/usr/local/bin'
MAX_SIZE=104857600
repo_size=`du -s $repo | cut -f 1`

if [ $repo_size -ge $MAX_SIZE ]; then
  echo "Repositroy $repo has exceeded maximum size: $MAX_SIZE" 1>&2
  exit 1
fi

  • application/pgp-signature attachment: stored
Received on Mon Oct 11 16:25:14 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.