We have a laptop that is plugged in all the time when it’s at home. Is the best method for routine backups of this laptop simply to disable sleep|hibernate?
Other (desktop) computers are backed up in the middle of the night. All our desktops and the laptop run 24x7, but the laptop will go to sleep in it’s current configuration. Network is unavailable on the laptop during sleep or hibernation, so obviously it won’t back up during those times. There is no time of day where I can guarantee that the laptop will be in use and thus not sleeping. Laptop usage is daily, but time of usage and length of usage is random.
I have not looked, but I assume I can configure this laptop to only power down the screen and not sleep or hibernate when on AC power. Older laptops we have had in the past supported this, the current laptop is fairly new and a higher end model so I assume it will as well.
Quick yet inefficient solution to your issue is to turn off sleep when plugged in. Inefficient meaning that your laptop will run 24/7.
- Right Click Windows Icon in Taskbar
- Click Settings
- Power & Battery
Most likely there is a way to “wake” a laptop up from sleep or hibernation at a given time to backup and then go back to sleep or hibernation. But I have not looked into this at all.
Also I don’t use hibernation at all. I still find it buggy, even after all these years.
Thanks for the reply!
I turned off sleeping on the laptop when it’s plugged into AC power. That’s what I was planning on doing initially, but thought I’d ask here if there were better solutions. I already have several computers and servers running 24x7 in my house, and this laptop draws the least power of all of them. Having good backups is more important to me than saving a penny or two on my electric bill by having the laptop go to sleep.
For my home computers, I just let the backups run when it’s time. For laptops, that means sometimes after waking, the backup runs. I have found that most of the time, I don’t even notice.
For windows, you could do something with a scheduled task to stop the client service on battery and restart it on AC or something. You could also create a group and throttle the backups if you’re worried about performance.
Windows task scheduler has an option labeled “wake the computer to run this task”. In theory, you could then have a task that is a script that disables power saving temporarily, runs the backup manually, then enables the power saving again.
I guess it depends on your exact needs since this would require always running the task at the same time, etc.
That trick works;
Scenario: got an old, quite power hungry machine in my attic with lots of old drives running urbackupsrv, 3 times a day it is woken up by my home automation and resumes from hibernation. My father has a laptop, he lives somewhere remote. I configured a dummy task on his windows laptop to wake it up at 3am, at the same time my backup server resumes from hibernation. In the logs and the “last seen” i can see they communicate/see each other, however the laptop is gone before the backup is finished. If i had my backup server running 24/7 this would not be an issue of course, but this is just for personal/family use and like mentioned the machine in the attic is quite power hungry so i want it to be on only when needed.
I found this: Option to inhibit sleep during backup and Uroni claims urbackup should prevent the laptop to go back to sleep. Unfortunately that doesn’t seem to be the case.
I have written 2 scripts for the laptop, pre- and postfilebackup.bat that should change the power scheme to performance temporarily when the backup is running. I still need to test these, and of course you could adopt these to the pre- and postimagebackup.bat files if needed.
:: Commands in this file will be executed before each incremental or full file backup
powercfg -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
:: Commands in this file will be executed after each incremental or full file backup
powercfg -SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e
This assumes you have the “balanced” scheme set as default, you can find the GUIDs of the available schemes via
the current set scheme is indicated with an asterisk (*), or you can run
powercfg -GETACTIVE to obtain its GUID, which could be usefull if you want to make sure it will always return to its former state. More info on the powercfg command here: Powercfg command-line options | Microsoft Learn
So please note 3 remarks: untested and assumptions, the above GUIDs come from Windows 8.1, my father runs Windows 11, i am not sure if the GUIDs are universal or what power scheme he is running as default, so i will need to figure that out first running the mentioned commands. Lastly i noticed the post script is only run after the backup is finished, what if it doesnt? Also i dont know what the performance scheme does when the battery is really empty, does it still shut down/hibernate/sleep or will it keep running until there is no more juice? I happen to know my father mostly keeps his laptop on the ac adapter at night, and file backups only take a couple of minutes, so i am not to worried about these things atm.
For those interested in how to wake up a client from sleep; indeed i used the “dummy task” trick, (more info How to Set PC Wake Up Timers | Laptop Mag) but digging into this powercfg command i find there is a perhaps a caveat; it seems you can dis- and enable wake up timers depending on if the client is on ac power or battery, so if the client doesnt wake up, make sure wake up timers are enabled in the power scheme.