Author Topic: qube cleanup qb.remove  (Read 3000 times)

jesse

  • Sr. Member
  • ****
  • Posts: 40
qube cleanup qb.remove
« on: July 16, 2008, 03:07:40 AM »
I am writing a python script to harvest data we might want before removing old jobs from qube.  jobinfo works quite fine to get at the data I need.

I then have used qb.remove() to remove the job. 

The job is no longer returned by qb.jobinfo, but it still appears in the gui.  Is there another step that I should be taking?

thanks
jesse

Code: [Select]
import sys
sys.path.append( "/usr/local/pfx/qube/api/python" )
import qb
import MySQLdb

conn = MySQLdb.connect ( host = "localhost", user = "...", passwd = "...", db = "...")
cursor = conn.cursor ()
jobInfos = qb.jobinfo([]);
for job in jobInfos:
    if job['timecomplete'] < time()-30*86400:
        sql = "INSERT ... "
        try:
            cursor.execute(sql)
            qb.remove(job['id'])
        except:
            print "Oopsies!",job['id']
cursor.close();
conn.close();
« Last Edit: July 16, 2008, 03:45:53 AM by jesse »

jesse

  • Sr. Member
  • ****
  • Posts: 40
Re: qube cleanup qb.remove
« Reply #1 on: July 16, 2008, 03:50:32 AM »
Woops,
I guess I was being impatient or the gui was not refreshing as I expected.
It seems everything is working as it should.
cheers,