automated shutdown on empty queue

Feel free to talk about anything and everything in this board.
Post Reply
Gavyn88
Newbie
Newbie
Posts: 6
Joined: January 20th, 2012, 2:16 pm

automated shutdown on empty queue

Post 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!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: automated shutdown on empty queue

Post 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.
Gavyn88
Newbie
Newbie
Posts: 6
Joined: January 20th, 2012, 2:16 pm

Re: automated shutdown on empty queue

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: automated shutdown on empty queue

Post by shypike »

Well, you script should also check the time of day :)
Gavyn88
Newbie
Newbie
Posts: 6
Joined: January 20th, 2012, 2:16 pm

Re: automated shutdown on empty queue

Post 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) ::)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: automated shutdown on empty queue

Post by shypike »

You can ask that in the Scripts board.
Post Reply