1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-27 17:47:37 +01:00
bitwarden-server/util/MsSql/backup-db.sql
Mart124 8471f558e3 Improve mssql backups (#298)
* Improve mssql backups

* Launch DB backup at 23:59
2018-05-29 08:17:43 -04:00

11 lines
388 B
Transact-SQL

DECLARE @BackupFile varchar(100)
SET @BackupFile = '/etc/bitwarden/mssql/backups/vault_FULL_$(now).BAK'
DECLARE @BackupName varchar(100)
SET @BackupName = 'vault full backup for $(now)'
DECLARE @BackupCommand NVARCHAR(1000)
SET @BackupCommand = 'BACKUP DATABASE [vault] TO DISK = ''' + @BackupFile + ''' WITH INIT, NAME= ''' + @BackupName + ''', NOSKIP, NOFORMAT'
EXEC(@BackupCommand)