Commit c8f97de823d5f273b82429a5ffb940650ae2381c
1 parent
1bceef56
v1.34.2.0
Showing
5 changed files
with
160 additions
and
87 deletions
Show diff stats
Vrh.Log4Pro.MaintenanceConsole/Manager - BackupPackageManager.cs
@@ -87,7 +87,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | @@ -87,7 +87,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | ||
87 | Console.WriteLine(); | 87 | Console.WriteLine(); |
88 | var actualcursortop = Console.CursorTop; | 88 | var actualcursortop = Console.CursorTop; |
89 | var numberofprocessedfiles = 0; | 89 | var numberofprocessedfiles = 0; |
90 | - var upgradefiles = new Dictionary<string, CompareDirectoriesActions>(); | 90 | + var upgradefiles = new Dictionary<string, (CompareDirectoriesActions,string)>(); |
91 | string previousdirectory = null; | 91 | string previousdirectory = null; |
92 | foreach (var onefile in allfiles.OrderBy(p => Path.GetDirectoryName(p))) | 92 | foreach (var onefile in allfiles.OrderBy(p => Path.GetDirectoryName(p))) |
93 | { | 93 | { |
@@ -113,7 +113,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | @@ -113,7 +113,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | ||
113 | } | 113 | } |
114 | //ColorConsole.WriteLine($"DIFFERENT ({difftext}): {relativePath}", ConsoleColor.Yellow); | 114 | //ColorConsole.WriteLine($"DIFFERENT ({difftext}): {relativePath}", ConsoleColor.Yellow); |
115 | ColorConsole.WriteLine($"< {onefile} ({difftext}):", ConsoleColor.Yellow); | 115 | ColorConsole.WriteLine($"< {onefile} ({difftext}):", ConsoleColor.Yellow); |
116 | - upgradefiles.Add(onefile, CompareDirectoriesActions.CopyFROMUPGRADE); | 116 | + upgradefiles.Add(onefile, (CompareDirectoriesActions.CopyFROMUPGRADE, $"({difftext})")); |
117 | } | 117 | } |
118 | } | 118 | } |
119 | else if (inWORKFolder) | 119 | else if (inWORKFolder) |
@@ -126,7 +126,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | @@ -126,7 +126,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | ||
126 | } | 126 | } |
127 | //ColorConsole.WriteLine($"ONLY IN Folder1: {relativePath}", ConsoleColor.Yellow); | 127 | //ColorConsole.WriteLine($"ONLY IN Folder1: {relativePath}", ConsoleColor.Yellow); |
128 | ColorConsole.WriteLine($"-- {onefile}", ConsoleColor.Yellow); | 128 | ColorConsole.WriteLine($"-- {onefile}", ConsoleColor.Yellow); |
129 | - upgradefiles.Add(onefile, CompareDirectoriesActions.DeleteINWORKING); | 129 | + upgradefiles.Add(onefile, (CompareDirectoriesActions.DeleteINWORKING,"")); |
130 | } | 130 | } |
131 | else if (inUPGRADEFolder) | 131 | else if (inUPGRADEFolder) |
132 | { | 132 | { |
@@ -138,17 +138,37 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | @@ -138,17 +138,37 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS | ||
138 | } | 138 | } |
139 | //ColorConsole.WriteLine($"ONLY IN Folder2: {relativePath}", ConsoleColor.Yellow); | 139 | //ColorConsole.WriteLine($"ONLY IN Folder2: {relativePath}", ConsoleColor.Yellow); |
140 | ColorConsole.WriteLine($"<< {onefile}", ConsoleColor.Yellow); | 140 | ColorConsole.WriteLine($"<< {onefile}", ConsoleColor.Yellow); |
141 | - upgradefiles.Add(onefile, CompareDirectoriesActions.CopyFROMUPGRADE); | 141 | + upgradefiles.Add(onefile, (CompareDirectoriesActions.CopyFROMUPGRADE,"(new file)")); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | ColorConsole.WriteLine(); | 144 | ColorConsole.WriteLine(); |
145 | - string movefiles = ColorConsole.ReadLine("Do You want to upgrade WORKING INSTALLATION with UPGRADE INSTALLATION:",validitylist: new List<string>{"yes","no","YES","NO", }, defaultvalue: "no", required: true); //@"C:\Path\To\Folder1"; | ||
146 | - if (movefiles.ToUpper() == "YES") | 145 | + ColorConsole.WriteLine("Do You want to upgrade WORKING INSTALLATION with UPGRADE INSTALLATION?"); |
146 | + ColorConsole.WriteLine(rootWORKING,prefix:" WORKING INSTALLATION root folder:"); | ||
147 | + ColorConsole.WriteLine(rootUPGRADE,prefix:" UPGRADE INSTALLATION root folder:"); | ||
148 | + string doupgradetxt = ColorConsole.ReadLine("Do upgrade?",validitylist: new List<string>{"yes","no","YES","NO","ask","ASK" }, defaultvalue: "no", required: true); | ||
149 | + if (doupgradetxt.ToUpper() == "EX") return o; | ||
150 | + if (doupgradetxt.ToUpper() == "YES" || doupgradetxt.ToUpper() == "ASK") | ||
147 | { | 151 | { |
148 | - foreach (var uf in upgradefiles) | 152 | + bool ask = doupgradetxt.ToUpper() == "ASK"; |
153 | + bool goontoall = false; | ||
154 | + foreach (var uf in upgradefiles) | ||
149 | { | 155 | { |
150 | - if (uf.Value == CompareDirectoriesActions.CopyFROMUPGRADE) { File.Copy(Path.Combine(rootUPGRADE, uf.Key), Path.Combine(rootWORKING, uf.Key)); } | ||
151 | - else if (uf.Value == CompareDirectoriesActions.DeleteINWORKING) { File.Delete(Path.Combine(rootWORKING,uf.Key)); } | 156 | + bool goon = true; |
157 | + if (ask && !goontoall) | ||
158 | + { | ||
159 | + string actiontext = uf.Value.Item1 == CompareDirectoriesActions.CopyFROMUPGRADE ? "upgrade" : "remove"; | ||
160 | + ColorConsole.WriteLine($"Do You want to {actiontext} file in WORKING INSTALLATION?"); | ||
161 | + var validitylist = new List<string> { "yes", "no", "YES", "NO", "yestoall", "YESTOALL", }; | ||
162 | + string goontxt = ColorConsole.ReadLine(uf.Key,f:ConsoleColor.Yellow, prefix:" file:",suffix:uf.Value.Item2, validitylist:validitylist, defaultvalue: "no", required: true); | ||
163 | + if (goontxt.ToUpper() == "EX") return o; | ||
164 | + goon = goontxt.ToUpper() == "YES"; | ||
165 | + goontoall = goontxt.ToUpper() == "YESTOALL"; | ||
166 | + } | ||
167 | + if (goon || goontoall) | ||
168 | + { | ||
169 | + if (uf.Value.Item1 == CompareDirectoriesActions.CopyFROMUPGRADE) { File.Copy(Path.Combine(rootUPGRADE, uf.Key), Path.Combine(rootWORKING, uf.Key), overwrite: true); } | ||
170 | + else if (uf.Value.Item1 == CompareDirectoriesActions.DeleteINWORKING) { File.Delete(Path.Combine(rootWORKING, uf.Key)); } | ||
171 | + } | ||
152 | } | 172 | } |
153 | } | 173 | } |
154 | return o; | 174 | return o; |
Vrh.Log4Pro.MaintenanceConsole/Manager - SQLDataBaseManager.cs
@@ -33,6 +33,8 @@ using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder; | @@ -33,6 +33,8 @@ using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder; | ||
33 | using System.Windows.Controls; | 33 | using System.Windows.Controls; |
34 | using Menu = Vrh.Log4Pro.MaintenanceConsole.MenuNS.Menu; | 34 | using Menu = Vrh.Log4Pro.MaintenanceConsole.MenuNS.Menu; |
35 | using static Vrh.Log4Pro.MaintenanceConsole.MenuNS.Menu; | 35 | using static Vrh.Log4Pro.MaintenanceConsole.MenuNS.Menu; |
36 | +using System.Security.AccessControl; | ||
37 | +using System.Data; | ||
36 | 38 | ||
37 | namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS | 39 | namespace Vrh.Log4Pro.MaintenanceConsole.SQLDataBaseManagerNS |
38 | { | 40 | { |
@@ -1382,10 +1384,10 @@ GO | @@ -1382,10 +1384,10 @@ GO | ||
1382 | #endregion private method: DisplayDataBaseInfo | 1384 | #endregion private method: DisplayDataBaseInfo |
1383 | #endregion private methods | 1385 | #endregion private methods |
1384 | } | 1386 | } |
1385 | - #endregion SQLDataBaseManager class | 1387 | + #endregion SQLDataBaseManager class |
1386 | 1388 | ||
1387 | - #region class SQLDataBaseManager | ||
1388 | - public static class SQLDataBaseManagerCore | 1389 | + #region class SQLDataBaseManagerCore |
1390 | + public static class SQLDataBaseManagerCore | ||
1389 | { | 1391 | { |
1390 | /// <summary> | 1392 | /// <summary> |
1391 | /// Egy adatbázis fizikai file-jainak mozgatása egy másik lokációba | 1393 | /// Egy adatbázis fizikai file-jainak mozgatása egy másik lokációba |
@@ -1539,14 +1541,26 @@ GO | @@ -1539,14 +1541,26 @@ GO | ||
1539 | finally { sqlserver?.ConnectionContext.SqlConnectionObject.Dispose(); } | 1541 | finally { sqlserver?.ConnectionContext.SqlConnectionObject.Dispose(); } |
1540 | } | 1542 | } |
1541 | 1543 | ||
1542 | - /// <summary> | ||
1543 | - /// Create SQL DB backup | ||
1544 | - /// </summary> | ||
1545 | - /// <param name="sqld">az sql db-t leíró descriptor</param> | ||
1546 | - /// <param name="forcecreatezip"></param> | ||
1547 | - /// <param name="timestamp"></param> | ||
1548 | - /// <returns></returns> | ||
1549 | - public static string CreateBackup(SQLDataBase sqld,bool? forcecreatezip, DateTime? timestamp,bool emulate=false) | 1544 | + private static void RunEXEOnRemoteComputer(string servername,string username, string password, string exefilename) |
1545 | + { | ||
1546 | + var processToRun = new[] { exefilename/*"notepad.exe"*/ }; | ||
1547 | + var connection = new ConnectionOptions(); | ||
1548 | + connection.Username = username; | ||
1549 | + connection.Password = password; | ||
1550 | + var wmiScope = new ManagementScope(String.Format(@"\\{0}\root\cimv2", servername), connection); | ||
1551 | + var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions()); | ||
1552 | + wmiProcess.InvokeMethod("Create", processToRun); | ||
1553 | + } | ||
1554 | + | ||
1555 | + | ||
1556 | + /// <summary> | ||
1557 | + /// Create SQL DB backup | ||
1558 | + /// </summary> | ||
1559 | + /// <param name="sqld">az sql db-t leíró descriptor</param> | ||
1560 | + /// <param name="forcecreatezip"></param> | ||
1561 | + /// <param name="timestamp"></param> | ||
1562 | + /// <returns></returns> | ||
1563 | + public static string CreateBackup(SQLDataBase sqld,bool? forcecreatezip, DateTime? timestamp,bool emulate=false) | ||
1550 | { | 1564 | { |
1551 | string backupdirectorypath = sqld.Xml_BackupTargetDirectoryPath; | 1565 | string backupdirectorypath = sqld.Xml_BackupTargetDirectoryPath; |
1552 | string tranzitdirectorypath = sqld.Xml_PrimaryDB_TranzitDirectoryPath; | 1566 | string tranzitdirectorypath = sqld.Xml_PrimaryDB_TranzitDirectoryPath; |
@@ -1599,57 +1613,32 @@ GO | @@ -1599,57 +1613,32 @@ GO | ||
1599 | 1613 | ||
1600 | if (!emulate) | 1614 | if (!emulate) |
1601 | { | 1615 | { |
1602 | - ColorConsole.WriteLine($"Database backup started...", ConsoleColor.DarkGreen); | ||
1603 | - if (File.Exists(backupFullName)) { File.Delete(backupFullName); } | ||
1604 | - var smoBackup = new Backup(); | ||
1605 | - smoBackup.Database = dbname; | ||
1606 | - smoBackup.Action = BackupActionType.Database; | ||
1607 | - smoBackup.BackupSetName = smoBackup.Database + " Backup"; | ||
1608 | - smoBackup.BackupSetDescription = $"Full Backup of {smoBackup.Database}"; | ||
1609 | - smoBackup.MediaDescription = "Disk"; | ||
1610 | - Console.WriteLine($"Backup set: {smoBackup.BackupSetName} ({smoBackup.BackupSetDescription}) to media: {smoBackup.MediaDescription}"); | ||
1611 | - string dummystring = sqld.Xml_PrimaryDB_IsUseTranzit ? " REMOTE SQL SERVER!" : ""; | ||
1612 | - Console.WriteLine($"Database name: {smoBackup.Database}{dummystring}"); | ||
1613 | - Console.WriteLine($"Connection string: {sqld.SQLCS_Primary}"); | ||
1614 | - smoBackup.Devices.AddDevice(sqld.Xml_PrimaryDB_IsUseTranzit ? tranzitFullName : backupFullName, DeviceType.File); | ||
1615 | - Console.WriteLine($"Backup full name:{backupFullName}"); | ||
1616 | - if (sqld.Xml_PrimaryDB_IsUseTranzit) | ||
1617 | - { | ||
1618 | - Console.WriteLine($" ...will be created through tranzit: {tranzitFullName}"); | ||
1619 | - } | ||
1620 | - smoBackup.PercentComplete += SmoBackupRestore_PercentComplete; | ||
1621 | - smoBackup.PercentCompleteNotification = 1; | 1616 | + ColorConsole.WriteLine($"Database backup started...", ConsoleColor.DarkGreen); |
1617 | + if (File.Exists(backupFullName)) { File.Delete(backupFullName); } | ||
1618 | + | ||
1619 | + | ||
1620 | + Console.WriteLine($"Backup set: {dbname + " Backup"} (Full backup of {dbname}) to media: Disk"); | ||
1621 | + string dummystring = sqld.Xml_PrimaryDB_IsUseTranzit ? " REMOTE SQL SERVER!" : ""; | ||
1622 | + Console.WriteLine($"Database name: {dbname}{dummystring}"); | ||
1623 | + Console.WriteLine($"Connection string: {sqld.SQLCS_Primary}"); | ||
1624 | + Console.WriteLine($"Backup full name:{backupFullName}"); | ||
1625 | + if (sqld.Xml_PrimaryDB_IsUseTranzit) { Console.WriteLine($" ...will be created through through tranzit {tranzitFullName}"); } | ||
1626 | + | ||
1627 | + var result = BackupDatabase(sqld.Xml_PrimaryDB_IsUseTranzit ? tranzitFullName : backupFullName, sqld.SQLCS_Primary, sqld.Xml_BackupTimeout, SmoBackupRestore_PercentComplete); | ||
1628 | + | ||
1629 | + Console.WriteLine($""); | ||
1630 | + Console.WriteLine("BACKUP " + (result.Success?"SUCCESS":"FAILURE") + ". " + result.Resulttext); | ||
1622 | 1631 | ||
1623 | - Server sqlserver = null; | ||
1624 | - try | ||
1625 | - { | ||
1626 | - sqlserver = SQLServerConnect(sqld.SQLCS_Primary, "master"); if (sqlserver == null) { return null; } | ||
1627 | - sqlserver.ConnectionContext.StatementTimeout = sqld.Xml_BackupTimeout; | ||
1628 | - backupstarttime = DateTime.Now; | ||
1629 | - smoBackup.SqlBackupAsync(sqlserver); | ||
1630 | - smoBackup.Wait(); | ||
1631 | - //smoBackup.Wait(); | ||
1632 | - Console.WriteLine($""); | ||
1633 | - Console.WriteLine($"Backup completed. Backup time: {(int)(DateTime.Now.Subtract(backupstarttime).TotalSeconds)}sec."); | ||
1634 | - } | ||
1635 | - catch (Exception ex) | ||
1636 | - { | ||
1637 | - ColorConsole.WriteLine($"ERROR! Database backup failed. DB name:'{smoBackup.Database}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.Red); | ||
1638 | - var errmsg = ""; while (ex != null) { errmsg += ";" + ex.Message;ex = ex.InnerException; } | ||
1639 | - ColorConsole.WriteLine(errmsg, ConsoleColor.Red); | ||
1640 | - return null; | ||
1641 | - } | ||
1642 | - finally { sqlserver?.ConnectionContext.SqlConnectionObject.Dispose(); } | ||
1643 | if (sqld.Xml_PrimaryDB_IsUseTranzit && File.Exists(tranzitFullName)) | 1632 | if (sqld.Xml_PrimaryDB_IsUseTranzit && File.Exists(tranzitFullName)) |
1644 | { | 1633 | { |
1645 | - File.Move(tranzitFullName, backupFullName); | ||
1646 | - Console.WriteLine($"Moving backup file..."); | ||
1647 | - Console.WriteLine($" ...from tranzit location: {tranzitFullName}"); | ||
1648 | - Console.WriteLine($" ...to backup location: {backupFullName}"); | 1634 | + Console.WriteLine($"Moving backup file..."); |
1635 | + Console.WriteLine($" ...from tranzit location: {tranzitFullName}"); | ||
1636 | + Console.WriteLine($" ...to backup location: {backupFullName}"); | ||
1637 | + File.Move(tranzitFullName, backupFullName); | ||
1649 | } | 1638 | } |
1650 | if (!File.Exists(backupFullName)) | 1639 | if (!File.Exists(backupFullName)) |
1651 | { | 1640 | { |
1652 | - ColorConsole.WriteLine($"ERROR! Database backup failed. DB name:'{smoBackup.Database}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.Red); | 1641 | + ColorConsole.WriteLine($"ERROR! Database backup failed. DB name:'{dbname}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.Red); |
1653 | return null; | 1642 | return null; |
1654 | } | 1643 | } |
1655 | if (createzip) | 1644 | if (createzip) |
@@ -1661,12 +1650,76 @@ GO | @@ -1661,12 +1650,76 @@ GO | ||
1661 | File.Delete(backupFullName); | 1650 | File.Delete(backupFullName); |
1662 | Console.WriteLine($"Zipping completed. Compressing time: {(int)(DateTime.Now.Subtract(startcompressing).TotalSeconds)}sec."); | 1651 | Console.WriteLine($"Zipping completed. Compressing time: {(int)(DateTime.Now.Subtract(startcompressing).TotalSeconds)}sec."); |
1663 | } | 1652 | } |
1664 | - ColorConsole.WriteLine($"SUCCESS! Database backup created. DB name:'{smoBackup.Database}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.DarkGreen); | 1653 | + ColorConsole.WriteLine($"SUCCESS! Database backup created. DB name:'{dbname}'. BAK/ZIP file name:'{Path.GetFileName(returnfilename)}'", ConsoleColor.DarkGreen); |
1665 | } | 1654 | } |
1666 | return returnfilename; | 1655 | return returnfilename; |
1667 | } | 1656 | } |
1668 | private static DateTime backupstarttime; | 1657 | private static DateTime backupstarttime; |
1669 | - private static void SmoBackupRestore_PercentComplete(object sender, PercentCompleteEventArgs e) | 1658 | + private static (bool Success, string Resulttext, string Header) BackupDatabase(string backuptargetfilename, string sqlconnectionstringtodatabase, int BackupTimeout, PercentCompleteEventHandler pcEventHandler) |
1659 | + { | ||
1660 | + string DatabaseName = ServerConnectionPool.GetSqlConnection(sqlconnectionstringtodatabase).Database; | ||
1661 | + string Header = $"Sql connection to database:{sqlconnectionstringtodatabase} Backup target:{backuptargetfilename}"; | ||
1662 | + string SUCCESSTEXT = "Done with SUCCESS; Time elapsed:{0}"; | ||
1663 | + string EXCEPTIONTEXT = "BACKUPEXCEPTION: {0}"; | ||
1664 | + string SERVERCONNECTIONFAILURETEXT = "SERVERCONNECTIONFAILURE"; | ||
1665 | + backupstarttime = DateTime.Now; | ||
1666 | + bool mode = false; | ||
1667 | + if (mode) | ||
1668 | + { | ||
1669 | + var SQLCtos = ServerConnectionPool.GetSqlConnection(sqlconnectionstringtodatabase, "master"); | ||
1670 | + string SqlConnectionStringToServer = SQLCtos.ConnectionString; | ||
1671 | + DatabaseName = "[" + DatabaseName + "]"; | ||
1672 | + string SQLBackUp = @"BACKUP DATABASE " + DatabaseName + " TO DISK = N'" + backuptargetfilename + @"'"; | ||
1673 | + SqlConnection cnBk = new SqlConnection(SqlConnectionStringToServer); | ||
1674 | + SqlCommand cmdBkUp = new SqlCommand(SQLBackUp, cnBk); | ||
1675 | + cmdBkUp.CommandTimeout = BackupTimeout; | ||
1676 | + Header = $"{SQLBackUp} {Header}"; | ||
1677 | + try | ||
1678 | + { | ||
1679 | + cnBk.Open(); | ||
1680 | + cmdBkUp.ExecuteNonQuery(); | ||
1681 | + return (true, string.Format(SUCCESSTEXT, DateTime.Now.Subtract(backupstarttime).TotalSeconds), Header); | ||
1682 | + } | ||
1683 | + catch (Exception ex) | ||
1684 | + { | ||
1685 | + var errmsg = ""; while (ex != null) { errmsg += ex.Message + ";"; ex = ex.InnerException; } | ||
1686 | + return (false, string.Format(EXCEPTIONTEXT, errmsg), Header); | ||
1687 | + } | ||
1688 | + finally | ||
1689 | + { | ||
1690 | + if (cnBk.State == ConnectionState.Open) { cnBk.Close(); } | ||
1691 | + } | ||
1692 | + } | ||
1693 | + else | ||
1694 | + { | ||
1695 | + var smoBackup = new Backup(); | ||
1696 | + smoBackup.Database = DatabaseName; | ||
1697 | + smoBackup.Action = BackupActionType.Database; | ||
1698 | + smoBackup.BackupSetName = smoBackup.Database + " Backup"; | ||
1699 | + smoBackup.BackupSetDescription = $"Full Backup of {smoBackup.Database}"; | ||
1700 | + smoBackup.MediaDescription = "Disk"; | ||
1701 | + smoBackup.Devices.AddDevice(backuptargetfilename, DeviceType.File); | ||
1702 | + smoBackup.PercentComplete += pcEventHandler; | ||
1703 | + smoBackup.PercentCompleteNotification = 1; | ||
1704 | + | ||
1705 | + Server sqlserver = null; | ||
1706 | + try | ||
1707 | + { | ||
1708 | + sqlserver = SQLServerConnect(sqlconnectionstringtodatabase, "master"); if (sqlserver == null) { return (false, string.Format(SERVERCONNECTIONFAILURETEXT), Header); } | ||
1709 | + sqlserver.ConnectionContext.StatementTimeout = BackupTimeout; | ||
1710 | + smoBackup.SqlBackup(sqlserver); | ||
1711 | + //smoBackup.SqlBackupAsync(sqlserver);smoBackup.Wait(); | ||
1712 | + return (true, string.Format(SUCCESSTEXT, DateTime.Now.Subtract(backupstarttime).TotalSeconds), Header); | ||
1713 | + } | ||
1714 | + catch (Exception ex) | ||
1715 | + { | ||
1716 | + var errmsg = ""; while (ex != null) { errmsg += ex.Message + ";"; ex = ex.InnerException; } | ||
1717 | + return (false, string.Format(EXCEPTIONTEXT, errmsg), Header); | ||
1718 | + } | ||
1719 | + finally { sqlserver?.ConnectionContext.SqlConnectionObject.Dispose(); } | ||
1720 | + } | ||
1721 | + } | ||
1722 | + private static void SmoBackupRestore_PercentComplete(object sender, PercentCompleteEventArgs e) | ||
1670 | { | 1723 | { |
1671 | ColorConsole.SetCursorPosition(0, Console.CursorTop); | 1724 | ColorConsole.SetCursorPosition(0, Console.CursorTop); |
1672 | ColorConsole.Write($"Completed: {e.Percent}%. {e.Message}. Backup time : {(int)(DateTime.Now.Subtract(backupstarttime).TotalSeconds)}sec."); | 1725 | ColorConsole.Write($"Completed: {e.Percent}%. {e.Message}. Backup time : {(int)(DateTime.Now.Subtract(backupstarttime).TotalSeconds)}sec."); |
@@ -2629,10 +2682,10 @@ GO | @@ -2629,10 +2682,10 @@ GO | ||
2629 | } | 2682 | } |
2630 | #endregion BackupSqlData | 2683 | #endregion BackupSqlData |
2631 | } | 2684 | } |
2632 | - #endregion class SQLDataBaseManager | 2685 | + #endregion class SQLDataBaseManagerCore |
2633 | 2686 | ||
2634 | - #region SQLDataBaseManager class | ||
2635 | - public class SQLDataBaseManagerXmlProcessor : XmlParser | 2687 | + #region SQLDataBaseManagerXmlProcessor class |
2688 | + public class SQLDataBaseManagerXmlProcessor : XmlParser | ||
2636 | { | 2689 | { |
2637 | #region fields | 2690 | #region fields |
2638 | private List<SQLDataBase> _sqldatabaselist; | 2691 | private List<SQLDataBase> _sqldatabaselist; |
@@ -2663,10 +2716,10 @@ GO | @@ -2663,10 +2716,10 @@ GO | ||
2663 | public List<SQLDataBase> GetDefinitionList() { return _sqldatabaselist; } | 2716 | public List<SQLDataBase> GetDefinitionList() { return _sqldatabaselist; } |
2664 | #endregion GetDefinitionList | 2717 | #endregion GetDefinitionList |
2665 | } | 2718 | } |
2666 | - #endregion SQLDataBaseManager class | 2719 | + #endregion SQLDataBaseManagerXmlProcessor class |
2667 | 2720 | ||
2668 | - #region SQLDataBase class | ||
2669 | - public class SQLDataBase : XmlLinqBase | 2721 | + #region SQLDataBase class |
2722 | + public class SQLDataBase : XmlLinqBase | ||
2670 | { | 2723 | { |
2671 | #region fields | 2724 | #region fields |
2672 | public bool Valid = true; | 2725 | public bool Valid = true; |
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | // [assembly: AssemblyVersion("1.0.*")] | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.34.1.0")] | ||
36 | -[assembly: AssemblyFileVersion("1.34.1.0")] | 35 | +[assembly: AssemblyVersion("1.34.2.0")] |
36 | +[assembly: AssemblyFileVersion("1.34.2.0")] |
Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj
@@ -347,23 +347,23 @@ | @@ -347,23 +347,23 @@ | ||
347 | <Reference Include="Microsoft.CSharp" /> | 347 | <Reference Include="Microsoft.CSharp" /> |
348 | <Reference Include="System.Data" /> | 348 | <Reference Include="System.Data" /> |
349 | <Reference Include="System.Xml" /> | 349 | <Reference Include="System.Xml" /> |
350 | - <Reference Include="VRH.Common, Version=4.1.1.0, Culture=neutral, processorArchitecture=MSIL"> | ||
351 | - <HintPath>..\packages\VRH.Common.4.1.1\lib\net462\VRH.Common.dll</HintPath> | 350 | + <Reference Include="VRH.Common, Version=4.1.4.0, Culture=neutral, processorArchitecture=MSIL"> |
351 | + <HintPath>..\packages\VRH.Common.4.1.4\lib\net462\VRH.Common.dll</HintPath> | ||
352 | </Reference> | 352 | </Reference> |
353 | - <Reference Include="VRH.Common.COM, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
354 | - <HintPath>..\packages\VRH.Common.4.1.1\lib\net462\VRH.Common.COM.dll</HintPath> | 353 | + <Reference Include="VRH.Common.COM, Version=4.1.3.0, Culture=neutral, processorArchitecture=MSIL"> |
354 | + <HintPath>..\packages\VRH.Common.4.1.4\lib\net462\VRH.Common.COM.dll</HintPath> | ||
355 | </Reference> | 355 | </Reference> |
356 | - <Reference Include="VRH.Common.EF, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
357 | - <HintPath>..\packages\VRH.Common.4.1.1\lib\net462\VRH.Common.EF.dll</HintPath> | 356 | + <Reference Include="VRH.Common.EF, Version=4.1.3.0, Culture=neutral, processorArchitecture=MSIL"> |
357 | + <HintPath>..\packages\VRH.Common.4.1.4\lib\net462\VRH.Common.EF.dll</HintPath> | ||
358 | </Reference> | 358 | </Reference> |
359 | - <Reference Include="VRH.Common.Log4ProIS, Version=4.1.1.0, Culture=neutral, processorArchitecture=MSIL"> | ||
360 | - <HintPath>..\packages\VRH.Common.4.1.1\lib\net462\VRH.Common.Log4ProIS.dll</HintPath> | 359 | + <Reference Include="VRH.Common.Log4ProIS, Version=4.1.4.0, Culture=neutral, processorArchitecture=MSIL"> |
360 | + <HintPath>..\packages\VRH.Common.4.1.4\lib\net462\VRH.Common.Log4ProIS.dll</HintPath> | ||
361 | </Reference> | 361 | </Reference> |
362 | <Reference Include="Vrh.Web.Providers, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL"> | 362 | <Reference Include="Vrh.Web.Providers, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL"> |
363 | <HintPath>..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll</HintPath> | 363 | <HintPath>..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll</HintPath> |
364 | </Reference> | 364 | </Reference> |
365 | - <Reference Include="Vrh.XmlProcessing, Version=2.8.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
366 | - <HintPath>..\packages\Vrh.XmlProcessing.2.8.0\lib\net45\Vrh.XmlProcessing.dll</HintPath> | 365 | + <Reference Include="Vrh.XmlProcessing, Version=2.9.5.0, Culture=neutral, processorArchitecture=MSIL"> |
366 | + <HintPath>..\packages\Vrh.XmlProcessing.2.9.5\lib\net462\Vrh.XmlProcessing.dll</HintPath> | ||
367 | </Reference> | 367 | </Reference> |
368 | <Reference Include="WindowsBase" /> | 368 | <Reference Include="WindowsBase" /> |
369 | </ItemGroup> | 369 | </ItemGroup> |
Vrh.Log4Pro.MaintenanceConsole/packages.config
@@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
73 | <package id="System.Threading.Timer" version="4.0.1" targetFramework="net472" /> | 73 | <package id="System.Threading.Timer" version="4.0.1" targetFramework="net472" /> |
74 | <package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="net472" /> | 74 | <package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="net472" /> |
75 | <package id="System.Xml.XDocument" version="4.0.11" targetFramework="net472" /> | 75 | <package id="System.Xml.XDocument" version="4.0.11" targetFramework="net472" /> |
76 | - <package id="VRH.Common" version="4.1.1" targetFramework="net472" /> | 76 | + <package id="VRH.Common" version="4.1.4" targetFramework="net472" /> |
77 | <package id="VRH.Web.Providers" version="2.0.2" targetFramework="net472" /> | 77 | <package id="VRH.Web.Providers" version="2.0.2" targetFramework="net472" /> |
78 | - <package id="Vrh.XmlProcessing" version="2.8.0" targetFramework="net472" /> | 78 | + <package id="Vrh.XmlProcessing" version="2.9.5" targetFramework="net472" /> |
79 | </packages> | 79 | </packages> |
80 | \ No newline at end of file | 80 | \ No newline at end of file |