views:

73

answers:

1

Does anyone happen to have some sort of a nice command line script they use that could do something like:

Clean VS project (delete \bin folder contents, etc)
Backup SQL Server database
Zip all files up

A: 

You'd have to plug in a lot of specifics for your environment so you might be best working from scratch. You might consider NAnt (or Ant on which it's based).

Here are the reference docs for the tasks you'll need to configure: http://nant.sourceforge.net/release/latest/help/tasks/delete.html http://nant.sourceforge.net/release/latest/help/tasks/exec.html* http://nant.sourceforge.net/release/latest/help/tasks/zip.html

* To back up SQL, you'll need to run the osql.exe command. Here are some other answers dealing with this issue: http://stackoverflow.com/search?q=osql%20backup

Here's an outline of a build file:

<?xml version="1.0"?>
<project name="buildMyStuff" default="build" basedir=".">
    <target name="clean" description="remove all generated files">
      <delete dir="temp/"/>
    </target>
    <target name="backupSQL">
      <exec program="C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql.exe">
        <arg value="-E"/>
      </exec>
    </target>
    <target name="zipFiles">
      <zip zipfile="files.zip">
        <fileset basedir="filesToZip/">
          <include name="*.*"/>
        </fileset>
      </zip>
    </target>
    <target name="build" depends="clean, backupSQL, zipFiles"/>
</project>
steamer25
Down voted you for the last link, because it's clear you didn't actually check the search results. The only post matching the search contained in the link is this one. It's self-referencing and absolutely no help. Canned answers are of no good to anyone.
Chris
Hrm. It is now. If you take the plus sign out of the resulting text box you get questions such as this: http://stackoverflow.com/questions/122690/what-is-a-simple-command-line-program-or-script-to-backup-sql-server-databases
steamer25
Changed the '+' to %20. Works better now.
steamer25
Fair enough. Down vote reversed. :)
Chris