I was looking for a way to backup all our SVN repositories, and came across this: http://www.darcynorman.net/2006/04/05/automatically-backing-up-multiple-subversion-repositories/
Because our repositories are organized in a client / project directory structure, i changed the script into this:
#!/bin/sh
SVN_REPOSITORIES_ROOT_DIR="/var/svn/repos/"
BACKUP_DIRECTORY="/home/hyperactive/public_html/svn/"
for CLIENT in `ls -1 $SVN_REPOSITORIES_ROOT_DIR`
do
echo 'dumping client: ' $CLIENT
mkdir $BACKUP_DIRECTORY/$CLIENT
for REPOSITORY in `ls -1 $SVN_REPOSITORIES_ROOT_DIR/$CLIENT`
do
echo 'dumping repository: ' $REPOSITORY
svnadmin dump $SVN_REPOSITORIES_ROOT_DIR$CLIENT/$REPOSITORY | gzip > $BACKUP_DIRECTORY$CLIENT/$REPOSITORY'.gz'
done
After running it (it completed the backup successfully), i get the following error on every repository that was to be backed up:
<m:human-readable errcode="2">
Could not open the requested SVN filesystem
</m:human-readable>
I looked in the apache error log, and this is what i found:
(20014)Internal error: Can't open file '/var/svn/repos/Test2/Test3.gz/format': No such file or directory, referer: http://10.4.2.254/svn/Test2
The way i see it, somehow the backup script added the .gz at the end of the repo path ([...]Test2/Test3**.gz**). After further cheking i noticed the single quotes surrounding the .gz extension in the script.
Any thoughts ?