Page 1 of 1

SABnzbd on Ubuntu 10.04 power management (sleep) manual

Posted: June 17th, 2010, 4:13 pm
by Zignut
Here is how I got my PC with SABnzbdplus 0.5.x on Ubuntu 10.04 LTS to sleep on queue completion:

1) install powernap on your Ubuntu:

Code: Select all

sudo apt-get install powernap

2) add the following to your sudoers:

Code: Select all

sudo visudo
*** Important: [username] is your normal username ***
*** Important: go to the bottom of the file and write: ***

Code: Select all

[username] ALL=(ALL) NOPASSWD: /usr/sbin/powernap
Press CTRL+X
Press Y
Press Enter

This allows you to run powernap without having to type in root password.
You can at this point test that is works by rebooting and typing the following in a terminal:

Code: Select all

sudo /usr/sbin/powernap
If it sleeps without asking for root password it works :).


3) create a script for sabnzbd and a folder for the script:

I made a script folder in my /home/[username] folder

Code: Select all

mkdir /home/[username]/script
make the script (called sleep):

Code: Select all

nano /home/[username]/script/sleep
Type the follwing:

Code: Select all

#!/bin/bash
sudo /usr/sbin/powernap
Press CTRL+X
Press Y
Press Enter

CHMOD the script so it is executable:

Code: Select all

CHMOD 775 /home/[username]/script/sleep
Again you can check yur script by typing the following in a terminal:

Code: Select all

/home/[username]/script/sleep
4) Next step is to tell SABnzbd where your script folder is located.

In your sabnzbd webinterface go to General -> Folders and type "script/" in the "Post-Processing Scripts Folder:".
Click "Save changes".
Click "home" and you can now select your "sleep" script in the "On queue finish" drop down box.

Enjoy!

-Zignut