[Rake-devel] rake snippets

Simon Strandgaard neoneye at gmail.com
Sun Sep 11 07:04:51 EDT 2005

Sometimes when eating I browse around the net, to see if I can find 
something useful. Today I wanted to see if there were a collection
of useful rake tasks. I am not looking for anything particular,
but perhaps my rake task for doing the daily svn backup could be
simplified.. stuff like that.

So perhaps it would be a good thing to start such snippet collection?

Thanks for a wonderful tool :-)

Simon Strandgaard

# here is my 'svn backup snippet'..

task :default => :svnbackup

task :svnbackup do
	repos = '/Users/simonstrandgaard/code/svnrepos'

	revstr = `svnlook youngest #{repos}`
	rev = '_rev' + revstr.match(/\d+/).to_s
	#p rev

	filename = 'backup' + Time.now.strftime('%Y%m%d')
	filename += rev
	filename += '.gz'
	p filename

	sh "svnadmin dump #{repos} | gzip -9 > #{filename}"

More information about the Rake-devel mailing list