Skip to content

Instantly share code, notes, and snippets.

@rockarts
Created August 9, 2011 22:16
Show Gist options
  • Save rockarts/1135355 to your computer and use it in GitHub Desktop.
Save rockarts/1135355 to your computer and use it in GitHub Desktop.
A Class that uses SQLCMD runner to backup a database.
class Backup
def initialize(settings)
@settings = settings
end
def Run()
"#{@settings['sqlcmd']} -E -Q \" BACKUP DATABASE #{@settings['projectname']} TO DISK = \'#{@settings['database_path']}#{@settings['projectname']}.bak\'\""
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment