<?php
// 设置跨域头
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:PUT,POST,GET,DELETE,OPTIONS');
header('Access-Control-Allow-Headers:*');
header('Content-Type:application/json; charset=utf-8');
$file = isset($_FILES['file']) ? $_FILES['file']:null; //分段文件
$name = isset($_POST['name']) ? $_POST['name']:null; //文件名
# 生成备份文件 && 打包为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"
# cer 转 pfx
openssl pkcs12 -export -out fullchain.pfx -inkey private.key -in fullchain.cer
# p7b 转 crt
openssl pkcs7 -print_certs -in fullchain.p7b -out fullchain.crt
# 分解命令:
pkcs12 # OpenSSL中PKCS#12文件的文件实用程序
-export -out fullchain.pfx # 导出并保存
-inkey private.key # 使用私钥文件作为与证书结合的私钥