-
I've got strange issue with trying to run .bat script file as Barckrest Hook Command. Everything seems to work just fine on Windows 10, but on Windows Server 2016 system just bypassing execution of script contents, but when I check logs - Backrest report as if execution was ok, without any errors. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Additional information. When I look at Hook Output window on Windows Server 2016: [script] [powershell -NoLogo -NoProfile -Command -] so system just state that it should execute this .bat file but right after we got [tasklog] section If I check similar Hook Output windows on different workstation running under Windows 10 Pro OS then different output could be seen: [script] [powershell -NoLogo -NoProfile -Command -] So, as one could see in this case we got output from script execution process. But on Windows Server 2016 nothing happens at all. Any advice on what might be wrong and how to fix that? Is there a way to trace execution in more detail somehow? Or to increase debug level? Right now no errors in Backrest log files. |
Beta Was this translation helpful? Give feedback.
-
Issue was a bit urgent - so I had to find solution for it ASAP. As a result following workaround could be used to resole it, but it would require rebuilding of Backrest on Windows (after replacing "powershell" by "pwsh" in "if runtime.GOOS == "windows" {" section, file command.go, located in internal\hook\types subfolder) and installing PowerShell 7.5 from https://github.com/PowerShell/PowerShell/releases and adding path to it's location to $PATH Windows environment variable. Then backrest.exe was replaced by new updated version and restarted. This trick allowed to solve issues with Hook Command submodule on Windows Server 2016 (tested on a number of servers). It would be nice if option added to Backrest to setup type and version of powershell on Windows (for example by setting an environment variable). Plan to submit an enhancement request. |
Beta Was this translation helpful? Give feedback.
Issue was a bit urgent - so I had to find solution for it ASAP. As a result following workaround could be used to resole it, but it would require rebuilding of Backrest on Windows (after replacing "powershell" by "pwsh" in "if runtime.GOOS == "windows" {" section, file command.go, located in internal\hook\types subfolder) and installing PowerShell 7.5 from https://github.com/PowerShell/PowerShell/releases and adding path to it's location to $PATH Windows environment variable.
Then backrest.exe was replaced by new updated version and restarted. This trick allowed to solve issues with Hook Command submodule on Windows Server 2016 (tested on a number of servers). It would be nice if option a…