HTCondor Time Based constraints
HTCondor Time Constraints are something I’ve had more difficulty finding basic information on than anything else. Here is a simple example that will allow you to view held jobs that have been stuck for more then 24 hours.
Time Constraint
The following generates a time value of how long jobs have been in their current status. Using that as a baseline, you can do a few cool things. First Remember/Know HTCondor uses time in seconds, and 3600 Seconds are in an hour.
"CurrentTime-EnteredCurrentStatus"
Implementation
So to get all jobs that have been stuck in “hold”(status 5) for more then a day:
condor_q -constraint "(CurrentTime-EnteredCurrentStatus > 3600*24) && (JobStatus == 5)"
You can then modify your basic time principle to hit whatever target you want, and simply by changing condor_q to condor_rm to remove old jobs from your queue!