Delete orphaned jobs in Condor

I had occasion recently to delete a lot of jobs in Condor that were orphaned. This means that they’d stalled, condor_rm had been called on them, and they’d kept the machines “claimed”. condor_rm -forcex had removed them from the global queue but the machines remained claimed!

In this situation, we really need to call condor_vacate on each machine to kick the stalled jobs off. This is done with condor_vacate machineAddress. But we had a lot of jobs under one user, so a bit if piping was needed…


condor_status -claimed |grep username |sed -r 's/[A-Za-z0-9]+@([a-zA-Z0-9]+).*/\1.xx.xx.stir.ac.uk/g'|xargs condor_vacate

condor_status -claimed lists all the machines that are claimed

grep username filters the machines to only the user in question

sed is extracting the machine names, and completing the full address

xargs passes each machine name as an argument to condor_vacate

Job done!

Leave a Comment

Your email address will not be published.