www.devco.net by r.i.pienaar

13Jan/102

Backing up Google Code projects

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.

About R.I. Pienaar

Systems Administrator, Consultant, Linux Guy, Automator, Ruby Coder
Comments (2) Trackbacks (0)
  1. I’ve been using svnsync lately for a write-through Subversion cache for remote SVN servers (Ah, South African connectivity…). A cute hack I found for setting up pre-revprop-change:

    ln -s /bin/true hooks/pre-revprop-change

  2. That’s a good hack and like most good hacks totally obvious in hindsight :P

    will adjust my code


Leave a comment


No trackbacks yet.