Page 1 of 1

Automatic Purge (in Schedule maybe? or via API)

Posted: August 30th, 2012, 5:46 pm
by dogzipp
Is there a switch available to have your History purge automatically after 24 hours of so? I have many friends running SABnzbd automatically, with almost no human intervention, yet sometimes downloads fail, and they pile up in your history, until they the failed NZB files get purged.

Or if a switch is not possible for automatic purging, a schedule option to "purge failed nzbs" would be great, so we can schedule it once a day. (or via an API call)

Thanks

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: August 31st, 2012, 1:51 am
by shypike
An API call is already available.
This will delete all failed jobs including their files.

Code: Select all

api?mode=history&name=delete&value=all&failed_only=1&del_files=1
Successful entries will not be deleted, but those entries don't cost much
and you're not going to look at the UI anyway :)

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: August 31st, 2012, 11:52 am
by dogzipp
Great. That will work for now. Hopefully, there will be a way to schedule it at some point later on (for users that use RSS instead of the API).

(I've been deploying media centers to several customers using SABnzbd, XBMC, etc). Most of the users never use the GUI at all, since everything is set up to use RSS or the API (if they can't open the TPC port succesfully). So a way to schedule it at some point would be greatly beneficial.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: August 31st, 2012, 1:02 pm
by shypike
Not sure about this one.
The wishlist of the users is enormous and each feature costs time.
Even a thing like this costs at least an hour, including testing.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 3rd, 2012, 6:18 am
by Illium
My first post here. First, I'd like to thank dogzipp for such an excellent question
and shypike for providing an answer

I want to do exactly the same thing, but I am not sure what to do with the api , do i put:

http://localhost:8080/sabnzbd/api?mode= ... el_files=1

It says API KEY missing... not sure what to do now...

Anyway, great help thanks!

Edit 1:

I figured it out, I am not entirely useless.

http://localhost:8080/sabnzbd/api?mode= ... [b]<INSERT YOUR OWN API KEY HERE FOR SABNZBD>[/b]

Edit 2:

I guess there is no way to automate this process like every so often, even in windows or with a batch file?

Edit 3:

For all those interested, i found a solution for that as well. This is rather a workaround though.

I created a task in Windows taskplanner or scheduler, whatever it is called in our language.
And set the interval to every day and run program. I linked to a shortcutI create of Firefox.
I set the properties of this shortcut to "Start minimized" and the attribute in Taskscheduler to: http://localhost:8080/sabnzbd/api?mode= ... =1&apikey=<YOUR API KEY>

My history is now purged every day automatically on my server.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 3rd, 2012, 8:29 am
by shypike
The feature has been implemented in 0.7.4.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 3rd, 2012, 11:32 am
by Illium
Cool! Where can I download 0.7.4?

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 3rd, 2012, 11:52 am
by shypike
Just released, see Announcements.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 3rd, 2012, 12:09 pm
by Illium
You are a star

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 7th, 2012, 3:09 am
by Illium
The new "Remove Failed Job" does not seem to work for me, at least not in the same way your API CALL did.

Whenever I opened up the above mentioned APICALL url, my entire history would get wiped.
With the schedule set job my history remains intact.

Re: Automatic Purge (in Schedule maybe? or via API)

Posted: October 7th, 2012, 4:10 am
by shypike
That because it's aimed at deleting failed items.
The assumption is that you still want to know what did download.
Also, the cost of history for successful downloads is negligible, unlike that of failed items.
Just erase it once a month :)