shared_libs/vars/sqlcmdBackup.groovy
2023-04-17 01:01:49 +02:00

9 lines
355 B
Groovy

def call(Map config=[:]) {
def srv = config.srv
def db = config.db
def file = config.file
def cmd = 'sqlcmd -S ' + srv + ' -E -Q "BACKUP DATABASE [' + db + "] TO DISK = N'" + file + "' WITH NOFORMAT, INIT, NAME = N'" +
db + "-Full Database Backup'" + ', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10"'
cmd( script: cmd )
}