From 1df6110649be1dba0c11fd10996fbe6e79e9a167 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 May 2023 16:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E5=B8=83=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PublishSite/PublishForm.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PublishSite/PublishForm.cs b/PublishSite/PublishForm.cs index c404afc4..20047e71 100644 --- a/PublishSite/PublishForm.cs +++ b/PublishSite/PublishForm.cs @@ -333,7 +333,7 @@ namespace PublishSite //备份后端文件 WinformLog($"备份后端文件..."); - string archivePath = $"{backupFolderPath}\\NetCore_{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}.zip"; + string archivePath = $"{backupFolderPath}\\NetCore_{DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss")}.zip"; var compressCommand = client.CreateCommand($"powershell.exe Compress-Archive -Path \"{programFolder}\\*.*\" -DestinationPath \"{archivePath}\" -Force"); compressCommand.Execute(); if (compressCommand.ExitStatus != 0) @@ -357,7 +357,7 @@ namespace PublishSite WinformLog($"开始备份数据库{dbName}..."); - string databaseBackupPath = $"{backupFolderPath}\\db_{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}.bak"; + string databaseBackupPath = $"{backupFolderPath}\\db_{DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss")}.bak"; var sqlcommand = client.CreateCommand($"sqlcmd -S . -U \"{dbUser}\" -P \"{dbPwd}\" -Q \"BACKUP DATABASE [{dbName}] TO DISK='{databaseBackupPath}' WITH INIT\""); sqlcommand.Execute(); if (sqlcommand.ExitStatus != 0)