keep computer from sleeping when terminal is active
On Ubuntu 10.10, I have set my power management preferences to put computer to sleep when inactive for 2 hours.
I run a long-running job in the terminal (it will run for days). After the 2 hours, Ubuntu sleeps my computer.
Is there a way to tell Ubuntu that the job running in the terminal constitutes activity and hence the computer should not sleep while it is running?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- mycae
- Solved:
- 2010-12-20
- Last query:
- 2010-12-20
- Last reply:
- 2010-12-20
|
#1 |
run this command before you start your job:
OLD_POWER_
gconftool-2 --set /apps/gnome-
--- Do job ---
gconftool-2 --set /apps/gnome-
Roy Lowrance (roy-lowrance) said : | #2 |
thx.
Would be nice to be able to do this through the UI though.
mycae (mycae) said : | #3 |
You can -- I assumed you wanted a way to batch automate it from the terminal.
Go to the power settings, and disable the sleep function.
System-
Roy Lowrance (roy-lowrance) said : | #4 |
That's what I do now.
I would think that jobs started explicitly from a terminal would count as activity and hence even the Power Management panel would not count the compute as inactive when these jobs were running.
mycae (mycae) said : | #5 |
You could modify gnome-terminal to actually be a shell script with those settings.
==FILE CONTENTS BELOW====
#!/bin/bash
OLD_POWER_
gconftool-2 --set /apps/gnome-
real-gnome-terminal
gconftool-2 --set /apps/gnome-
==FILE CONTENTS ABOVE====
Just be aware that updates could knock this out. Or you could call it "my-gnome-terminal" instead.