Skip to main content

Sleep mode - conditional wake up and going to sleep after backup

Thread needs solution

Hello, is it possible to put the pc to sleep again, after a backup has run, on the condition that the backup itself woke up the pc in the first place. If the backup was triggered while the pc was not in sleep mode, it should not enter it. I probably need to run the post script to put the pc to sleep, but is there any condition to check that can satisfy this requirement? Does anyone maybe have a solution for this which they can share? Personally, I was wondering if I could use the parsed output returned by powerfcg: C:\Users\xyz>powercfg -lastwake Wake History Count - 1 Wake History [0] Wake Source Count - 1 Wake Source [0] Type: Wake Timer Owner: [SERVICE] \Device\HarddiskVolume5\Program Files (x86)\Common Files\Acronis\Schedule2\schedul2.exe (AcrSch2Svc) Or the output from query user: C:\Users\xyz>query user USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME >xyz console 2 Active 1+07:21 9/20/2019 7:28 AM and if a (specific) console user is logged in, do not go to sleep. But as said before, I'm would probably have to figure out how to put this in a batch/powershell (whatever is best) script, therefore the question, if someone has a working solution.

0 Users found this helpful

Christoph, the simplest solution here would be to ensure that your computer is set to go to sleep after a short period of inactivity and have your ATI backup task set to prevent sleep while the backup is active, so that when the backup completes, Windows will handle the business of putting the computer to sleep normally.

Ditto to Steve!

Also, just to note, I can only thank the original post and not Steve's for some reason.

 

I have been battling with this same problem for a year or more.......it USED to work OK until, I think possibly the May 2019 windows 10 update

I have tried various post commands but although they appear to work, the backup doesnt appear to complete until I wake the PC again - e.g. if it completes at say 02:35 and sleeps, when I awake it at 07:30 the log shows completion time as 07:30!

I literally just tried this    https://forum.acronis.com/forum/best-practices-data-protection/grovers-alternate-method-shutdown-computer-after-backup-separate-batchcommand-file      but it didnt work

I also tried calling this as a post command (shutdown.cmd)    rundll32.exe powrprof.dll,SetSuspendState 0,1,0   

 and although it appears to work, when I opened the PC again I was greeted with a message "are you sure you want to stop the operation".....I have set the PC to sleep after an hour but 5 hours later it is still on :(

Thought I was the only person who wanted to wake a sleeping PC, run the backup then re-sleep the PC.....good to know there are at least two of us !!

I saw this reply   https://forum.acronis.com/forum/acronis-true-image-2018-forum/shutdown-after-backup-other-options    but again that seems to prevent the backup from fully completing as above

 

Seems we need some sort of file that is triggered a few seconds after Acronis closes ..... feasible ????

David, I have just tested this on my Windows 10 laptop and ATI 2020 woke up the laptop from sleep, performed a differential disk backup on schedule, then the laptop went back to sleep again after a delay of 10 minutes.

The only change that I had to make was to enable wake timers in order to be given the option to wake the sleeping/hibernating computer in the Advanced Schedule options as per KB 54530: Acronis True Image: Option "Wake up the sleeping/hibernating" is not available

TurnedOnTimesView is from Nirsoft is a free download to identify Sleep & Wake times.

The backup task ti_demon log shows:

18/11/2019 15:45:00 :378  -----
18/11/2019 15:45:00 :378  ATI Demon started. Version: 24.4.1.21400.
18/11/2019 15:45:00 :436  Backup reserve copy attributes: format tib; need_reserve_backup_copy false;
18/11/2019 15:45:00 :438  Operation Win 10 SSD Diff E started by schedule.
18/11/2019 15:45:01 :016  Backup reserve copy attributes: format tib; need_reserve_backup_copy false;
18/11/2019 15:45:01 :017  Operation: Backup
18/11/2019 15:45:01 :018  Priority changed to Low.
18/11/2019 15:48:59 :245  Operation has succeeded.

The Schedul2 log shows the following events:

18/11/2019 15:44:00 :731  PowerRegisterSuspendResumeNotification callback: Type = 0x12 (PBT_APMRESUMEAUTOMATIC)
18/11/2019 15:44:00 :736  OnServiceMainWake: begin
18/11/2019 15:44:00 :736  next wake up time = 18.11.2019 15:45:00
18/11/2019 15:44:00 :736  SetWaitableTimer(132185655000000000): > error=0
18/11/2019 15:44:00 :737  OnServiceMainWake: next time = 18.11.2019 15:45:00
18/11/2019 15:44:00 :739  OnServiceEvent(SE_POWER)
18/11/2019 15:44:00 :739  power event 0x12 (PBT_APMRESUMEAUTOMATIC) received

18/11/2019 15:45:00 :000  OnServiceMainWake: begin
18/11/2019 15:45:00 :000  Trying task 1-21 as TIME_NORMAL
18/11/2019 15:45:00 :000  Stored token 00000000 replaced with 00000000
18/11/2019 15:45:00 :000  Windows fast startup state to disable: ENABLED PRESENCE
18/11/2019 15:45:00 :000  Windows fast startup state disabled: BACKUP PRESENCE
18/11/2019 15:45:00 :009  next wake up time = 19.11.2019 15:44:00
18/11/2019 15:45:00 :009  SetWaitableTimer(132186518400000000): > error=0
18/11/2019 15:45:00 :009  OnServiceMainWake: next time = 18.11.2019 18:30:00

18/11/2019 15:45:00 :016  Running task 1-21

18/11/2019 15:45:00 :053  Prevented from sleep: on

18/11/2019 15:49:03 :337  Task 1-21 completed with exit code=0
18/11/2019 15:49:03 :338  Windows fast startup state to enable: BACKUP PRESENCE
18/11/2019 15:49:03 :338  Windows fast startup state enabled: ENABLED PRESENCE
18/11/2019 15:49:03 :338  Stored token 00000000 replaced with 00000000
18/11/2019 15:49:03 :338  Prevented from sleep: off

18/11/2019 15:51:31 :690  OnServiceEvent(SE_POWER)
18/11/2019 15:51:31 :691  power event 0x4 (PBT_APMSUSPEND) received
18/11/2019 15:51:33 :990  PowerRegisterSuspendResumeNotification callback: Type = 0x4 (PBT_APMSUSPEND)

I never had RELIABLE success with this - it usually failed to put the PC to sleep so I use a windows scheduled task to open / start the backup and close it afterwards......and it has worked perfectly every day for the last 7 months :)

requires PS Tools to be loaded but thats all

Attachment Size
546266-188225.pdf 250.79 KB