Mirror site is read only www.netnr.com
netnr/ sqlserver-backup-database 2019-09-27 11:36
sqlserver备份数据并打包为zip
# 生成备份文件 && 打包为zip && 删除备份文件
sqlcmd -S . -U sa -P 123 -Q "BACKUP DATABASE netnr TO  DISK = '/package/data/netnr.bak' with format" && cd /package/data && zip -r netnr.zip netnr.bak && rm -rf netnr.bak
# 注意权限 chown mssql /package/data && chgrp mssql /package/data

# 备份
sqlcmd -S . -U sa -P 密码 -Q "BACKUP DATABASE 数据库 TO  DISK = '备份路径' with format"