PipelineFX Forum
Qube! => General => Topic started 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
-
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.
% 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)
-
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.
-
a late thank you!
I forgot to turn on notification for my post. :)
-
I was also looking for the solution of this problem. thanx to scott for his suggestion.