tags:

views:

40

answers:

3

I'd like to set up daily tarballs/zip archives on my host for an SVN of a related project. I do not have access to their server, however they do have a publicly accessible SVN. How would I grab this SVN and build archives with minimal load ( dreamhost shared ), via Cron task + php/shell script?

A: 

I wonder if Hudson would help. We use it for some of our continuous integration SVN and archiving work.

Inkspeak
A: 

You could do a svn checkout via a shell script and tar the dir you checked out. Note that a checkout will have the .svn files and meta data included.

This site http://www.linuxweblog.com/blogs/sandip/20090331/svn-checkout-shell-script and man tar should get you what you most of the way there.

You could also Check out phing it is like ant but built in PHP if you can do a checkout you can use the tar task.

Phing

Steve Robillard
A: 

I'm lost. Are you looking for a shell script?

#!/bin/sh

svn export http://svn.other-project.com/path/to/project /my/svn/path

tar -czf /my/tar/path/svn_project.tgz /my/svn/path

That would do the trick. You need to fill in whatever paths you want to store those files in. Store the file somewhere useful, like /usr/local/sbin/tarball_svn_project.sh

Using svn export means that you won't have .svn directories all over your tarball.

In Cron, you would add a line like this:

15 1 * * * /bin/sh /usr/local/sbin/tarball_svn_project.sh

That would run the shell script at 1:15 AM every day. You can change the numbers to control what time the script runs at.

mehaase