开发者

Php/Shell remote SVN tarballs

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?


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜