I have a script launched by a cron from an Kubuntu 12.04.01 LTS laptop to NAS. The script simply contains an rsync command backing up the laptop.
The problem is that if the system goes into standby mode, while the script is executing, the network manager crashes and the whole thing fails. Even without the crash, I would still like the computer to remain awake until the backup is finished.
Ideally, I would like to add a command at the top of the script to disable standby/hibernation and another at the end of the script to re-enable it before exiting the script.
I have seen these two related threads already, but neither quite gives me what I need (I think):