Page 1 of 1

automated shutdown on empty queue

Posted: January 20th, 2012, 2:49 pm
by Gavyn88
Hi I have a question about the automation of my SABnzbd, maybe it's a bit complicated, but I hope you understand and hopefully help me :)
I have a Zotac AD02 with openelec installed, on this device I also run SABnzbd 0.6.14 .

I use my router (Asus RT-n16 with DDWRT) to wakeup my Zotac in the middle of the night. On startup SABnzbd checks my Dropbox folder for new .nzb files. After importing, downloading and unpacking my Zotac will power off.

My question/problem is:

When my router powers on my SABnzbd (which happens every night) and there are NO nzb files to download. There is no job to complete/finish so there is no shutdown signal.

Do any of you have a way to check, either from my router, or my Zotac/openelec if it boots with an empty queue and therefor shuts down again.
Other ideas are welcome as long that the result is, that my Zotac does not stand idle the whole night. :)

Thanks for the replies!

Re: automated shutdown on empty queue

Posted: January 20th, 2012, 3:00 pm
by shypike
Assuming there is a startup script for SABnzbd,
add a line to test for the presence of an NZB file before you start SABnzbd,
otherwise: power off.

Re: automated shutdown on empty queue

Posted: January 20th, 2012, 3:19 pm
by Gavyn88
shypike wrote:Assuming there is a startup script for SABnzbd,
add a line to test for the presence of an NZB file before you start SABnzbd,
otherwise: power off.
I thought of this, but what happens if I want to watch a movie on my Zotac, SABnzbd starts up and shuts-down the Zotac immediately when the script runs. Therefor it will be impossible to start my Zotac unless there are nzb files to download.

I think this isn't the solution or do I understand it wrong.

Re: automated shutdown on empty queue

Posted: January 21st, 2012, 3:25 am
by shypike
Well, you script should also check the time of day :)

Re: automated shutdown on empty queue

Posted: January 21st, 2012, 4:47 am
by Gavyn88
OK, my next question is how do I check if the queue is empty?
I have created a autorun.sh script which runs on startup (To start my Dropbox sync) but how do I add the "check time" and "check empty queue" in a specific timeslot.
(I'm not much of a scriptor) ::)

Re: automated shutdown on empty queue

Posted: January 21st, 2012, 5:28 am
by shypike
You can ask that in the Scripts board.