Select Page
NOTE: This is a static archive of an old blog, no interactions like search or categories are current.

Google Code does not provide it’s own usable export methods for projects so we need to make do on our own, there seems no sane way to back up the tickets but for SVN which includes the wiki you can use svnsync.

Here’s a little script to automate this, just give it a PREFIX of your choice and a list of projects in the PROJECTS variable, cron it and it will happily keep your repos in sync.

It outputs its actions to STDOUT so you should add some redirect or redirect it from cron.

#!/bin/bash
 
PROJECTS=( your project list )
PREFIX="/path/to/backups"
 
[ -d ${PREFIX} ] || mkdir -p ${PREFIX}
 
cd ${PREFIX}
 
for prj in ${PROJECTS[@]}
do
    if [ ! -d ${PREFIX}/${prj}/conf ]; then
        svnadmin create ${prj}
 
        ln -s /bin/true ${PREFIX}/${prj}/hooks/pre-revprop-change
 
        svnsync init file:///${PREFIX}/${prj} http://${prj}.googlecode.com/svn
    fi
 
    svnsync sync file:///${PREFIX}/${prj}
done

I stongly suggest you backup even your cloud hosted data.