PipelineFX Forum

Qube! => General => Topic started by: Achilles on January 13, 2011, 08:18:28 AM

Title: qbjobs: is it possible to show jobs older than x days?
Post by: Achilles on January 13, 2011, 08:18:28 AM
hi

I'd like to delete completed jobs older than x days.

In the GUI I can see "timecomplete" and "timesubmit" but "qbjobs -h"  does not mention any of this.

is it somehow possible to show jobs older than x days with qbjobs?

- Thomas
Title: Re: qbjobs: is it possible to show jobs older than x days?
Post by: Scot Brew on January 14, 2011, 08:09:35 PM
Yes, you can do this directly with Qube's python API.  Here's an example that uses qb.query.jobinfo() and qb.kill() to kill all non-terminal jobs last updated before Dec 1,2010.

Code: [Select]
% python
import qb.query
import datetime
jobids = [int(i['id']) for i in qb.query.jobinfo(updatedBefore=datetime.datetime(2010,12,1), basicFields=['id'], status=['running','pending','blocked'])]
qb.kill(*jobids)
Title: Re: qbjobs: is it possible to show jobs older than x days?
Post by: Scot Brew on January 14, 2011, 08:13:18 PM
A feature request has also been made for enhanced filtering that would include things like jobs since xxx.  It will be in the 6.2 release.
Title: Re: qbjobs: is it possible to show jobs older than x days?
Post by: Achilles on January 18, 2011, 01:52:41 PM
a late thank you!

I forgot to turn on notification for my post. :)
Title: Re: qbjobs: is it possible to show jobs older than x days?
Post by: David Stone on March 16, 2011, 04:13:16 AM
I was also looking for the solution of this problem. thanx to scott for his suggestion.