Skip to content

Instantly share code, notes, and snippets.

@jalchr
Created October 19, 2011 21:03
Show Gist options
  • Save jalchr/1299665 to your computer and use it in GitHub Desktop.
Save jalchr/1299665 to your computer and use it in GitHub Desktop.
Raven Backup
<target name="BackupRavenDb">
<exec program="Raven.Backup" basedir="${BackupToolPath}" pidproperty="batch1.pid" spawn="true" >
<arg value="--url=http://localhost:8080" />
<arg value="--dest=${tempDirectory}${databaseName}" />
</exec>
<waitforexit pid="${batch1.pid}" />
<zip zipfile="${tempDirectory}${databaseName}.zip">
<fileset basedir="${tempDirectory}${databaseName}">
<include name="*.*" />
</fileset>
</zip>
<tstamp>
<formatter property="TODAY_SHORT" pattern="yyyy-MM-dd"/>
</tstamp>
<mkdir dir="${backupDirectory}${TODAY_SHORT}"/>
<copy todir="${backupDirectory}${TODAY_SHORT}">
<fileset basedir="${tempDirectory}">
<include name="*.zip"/>
</fileset>
</copy>
<delete file="${tempDirectory}${databaseName}.zip" />
<delete dir="${tempDirectory}${databaseName}" />
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment