This commit is contained in:
@@ -75,7 +75,7 @@ namespace AyaNova.Biz
|
|||||||
log.LogInformation($"CALLING BACKUP COMMAND: {BackupUtilityCommand} {Arguments}");
|
log.LogInformation($"CALLING BACKUP COMMAND: {BackupUtilityCommand} {Arguments}");
|
||||||
|
|
||||||
//RUN THE BACKUP
|
//RUN THE BACKUP
|
||||||
var Result= RunProgram.Run(BackupUtilityCommand,Arguments);
|
var Result = RunProgram.Run(BackupUtilityCommand, Arguments, log);
|
||||||
log.LogInformation($"BACKUP RESULT: {Result}");
|
log.LogInformation($"BACKUP RESULT: {Result}");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace AyaNova.Util
|
namespace AyaNova.Util
|
||||||
{
|
{
|
||||||
@@ -8,7 +9,9 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public static string Run(string cmd, string arguments)
|
public static string Run(string cmd, string arguments, ILogger log = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
@@ -23,10 +26,21 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
return RunLinuxBash(cmd, arguments);
|
return RunLinuxBash(cmd, arguments);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new PlatformNotSupportedException();
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (log != null)
|
||||||
|
{
|
||||||
|
log.LogError(ex, $"RunProgram error running command:{cmd} {arguments}");
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
throw new PlatformNotSupportedException();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user