prevent sleep in scripts
- by Mr Fooz
Is there a way to prevent Windows from going into sleep mode while running a program on the command line or with cygwin? Ideally, I'm hoping for something that could be used like:
nosleep myscript.sh
Background
Sometimes I start up long-running jobs like a manual backup or large file transfers and I've found that Windows often goes to sleep before these finish. I'd like to be able to start up the command and prevent sleep mode while the command is running, but have it automatically work again once the command has completed.