Automatic Purge (in Schedule maybe? or via API)

Want something added? Ask for it here.
Post Reply
dogzipp
Newbie
Newbie
Posts: 49
Joined: April 3rd, 2012, 5:27 pm

Automatic Purge (in Schedule maybe? or via API)

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

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

Post 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 :)
dogzipp
Newbie
Newbie
Posts: 49
Joined: April 3rd, 2012, 5:27 pm

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

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

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

Post 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.
Illium
Newbie
Newbie
Posts: 4
Joined: October 3rd, 2012, 6:14 am

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

Post 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.
Last edited by Illium on October 3rd, 2012, 7:11 am, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

The feature has been implemented in 0.7.4.
Illium
Newbie
Newbie
Posts: 4
Joined: October 3rd, 2012, 6:14 am

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

Post by Illium »

Cool! Where can I download 0.7.4?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

Just released, see Announcements.
Illium
Newbie
Newbie
Posts: 4
Joined: October 3rd, 2012, 6:14 am

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

Post by Illium »

You are a star
Illium
Newbie
Newbie
Posts: 4
Joined: October 3rd, 2012, 6:14 am

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

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

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

Post 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 :)
Post Reply