Return to Snippet

Revision: 26621
at May 4, 2010 09:05 by throb


Initial Code
import qb, datetime

jobs = qb.jobinfo()

for job in jobs:
    
    now = datetime.datetime.today()
    then = datetime.datetime.fromtimestamp(job['timesubmit'])
    elapsed = now-then
    if elapsed.days > 10 :
        
        print str(job['id']) + ':' + str(job['timesubmit'])
        print 'Time elapsed %d days' % (elapsed.days)
        qb.remove(job['id'])

Initial URL

                                

Initial Description

                                

Initial Title
Remove jobs older than 10 days in Qube

Initial Tags
python

Initial Language
Python