Previously this had been an issue as the PC would sleep during the validation of a Backup, so I manually switched to an Always On power plan.
With the current PC build I was using, the PC would hang and not shut down cleanly if it was put into sleep and woken whilst an eSATA drive was attached to the 2-port STARTECH card I was using. Providing the PC did not sleep, all was fine.
I therefore looked for a means of automatically switching to always on for Backup runs. Rather than switch back to the normal power plan automatically after the backup, I elected to leave Always On set and switch back to normal on every startup. This way, I would be sure that if I still had the eSATA drive connected after a backup, the pc would not sleep.
This Acronis forum post which refers to this instructional pdf detail a workaround to the problem, which involves coding a batch file to switch power plans, and calling it as a pre/post custom command in Acronis in the backup settings.
In addition, as I wanted to set the plan back to normal at boot time, I used the technique from this StackOverflow post which worked correctly. Originally I had tried using a scheduled task triggered at boot time, but it refused to run and did not give a reason why.
My registry settings file, batch files, and vbs script are listed below for reference. Note that the GUIDS correspond to the particular power plans, and are unique for each one and different for each pc – see the above pdf for details of how to list the power plans with their corresponding GUIDs.
This fixed the problem, but I remain unimpressed that Acronis does not handle this automatically or have a setting for it in a backup definition. You can tell it to prevent sleep for scheduled backup runs, but not for manually initiated ones.
SetPowerPlanNormal.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"SetPowerPlanNormal"="wscript.exe \"C:\\System Management\\RunInvisibleBatchFile.vbs\" \"C:\\System Management\\SetPowerPlanNormal.bat\""
RunInvisibleBatchFile.vbs
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
SetPowerPlanNormal.bat
:: Change Power Plan to Normal.
::
@ECHO OFF
POWERCFG -SETACTIVE ccaec46d-cbf8-42af-9e8f-ab66182942f7
::
@EXIT
SetPowerPlanAlwaysOn.bat
:: Change Power Plan to AlwaysOn.
::
@ECHO OFF
POWERCFG -SETACTIVE 499ab33e-0735-4605-8ccc-98211478164b
::
@EXIT