Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use qdel all to remove only idle jobs

I am having an issue where if I have 2000 jobs queued and try to delete them with qdel all, it'll keep trying to delete the running jobs first. This means I have to wait a long time for the jobs to get deleted because removing from the Running list is slower than Idle list.

Thus how do I remove all Idle jobs without touching the Running jobs?

like image 906
user2763361 Avatar asked Nov 10 '22 14:11

user2763361


1 Answers

If the job ids are in sequential order, you could use Bash's brace extension. For example:

$ echo {0..9}
0 1 2 3 4 5 6 7 8 9

Transferred to delete all jobs ranging from 1000 to 2000, the qdel command would be:

qdel {1000..2000}

This might even work if there are job ids that you are not allowed to delete (from other users). They should be simply ignored. (not tested)

like image 104
user1251007 Avatar answered Nov 13 '22 04:11

user1251007