Author Topic: qbjobs: is it possible to show jobs older than x days?  (Read 9332 times)

Achilles

  • Sr. Member
  • ****
  • Posts: 25
qbjobs: is it possible to show jobs older than x days?
« 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

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: qbjobs: is it possible to show jobs older than x days?
« Reply #1 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)
« Last Edit: January 14, 2011, 10:58:00 PM by Scot Brew »

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: qbjobs: is it possible to show jobs older than x days?
« Reply #2 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.
« Last Edit: January 14, 2011, 10:57:04 PM by Scot Brew »

Achilles

  • Sr. Member
  • ****
  • Posts: 25
Re: qbjobs: is it possible to show jobs older than x days?
« Reply #3 on: January 18, 2011, 01:52:41 PM »
a late thank you!

I forgot to turn on notification for my post. :)

David Stone

  • Jr. Member
  • **
  • Posts: 4
Re: qbjobs: is it possible to show jobs older than x days?
« Reply #4 on: March 16, 2011, 04:13:16 AM »
I was also looking for the solution of this problem. thanx to scott for his suggestion.