shared_libs/vars/sqlcmdBackup.groovy

9 lines
355 B
Groovy
Raw Normal View History

2023-04-17 01:01:49 +02:00
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 )
}