0

I am running a lot of jobs with qsub: some are running, some are waiting. Is there a way to cancel all the jobs for a given user which are queued/waiting without giving the individual job IDs?

user443699
  • 133
  • 5
  • 1
    What does `man qsub` tell you? And if it can give a list of queued jobs it's unlikely to be terribly hard to have a scriptlet iterate across them cancelling them one at a time. – roaima Dec 13 '20 at 22:23
  • If this is Univa or Sub Grid Engine, then the command to kill jobs is `qdel`. `qsub` is for submitting jobs. – Nasir Riley Dec 13 '20 at 23:12
  • yes, I want to use `qdel`, but exclude jobs which are already running. I realise it's a basic question, but I couldn't figure out how to do this from the manual. My job IDs are not all consecutive numbers so `qdel {FIRSTID...LASTID}` does not work. – user443699 Dec 13 '20 at 23:30
  • If they are waiting, then you can use `qstat -u "username" | awk '$5=="qw" {print $1}'`. That will print all of the jobs for a specific user that are in waiting state. You can then pipe that into `qdel` or use `xargs`. – Nasir Riley Dec 14 '20 at 01:14

0 Answers0