Thursday, July 05, 2012

how to qdel a range of jobs


For example, I want to kill jobs with ids ranging from 7823111 to 7823118. One way to do it is of course to list all IDs after qdel, such as 


$ qdel 7823111 7823112 7823113 7823114 7823115 7823116 7823117 7823118


You can also do this in an elegant way, using seq command to generate the sequence number:


$ echo `seq -f "%.0f" 7823111 7823118`
7823111 7823112 7823113 7823114 7823115 7823116 7823117 7823118


Note that if you are using job array (-t) to control jobs, then it's easier to kill list of jobs in the array. Here is what "man qdel" says:

-t array_range
The array_range argument is an integer id or a range of integers. Multiple ids or id ranges can be combined in a comma delimted list. Examples: -t 1-100 or -t 1,10,50-100


7 comments:

  1. good one. there were no examples using range so it was not clear to me. I helped my case to delete some 100 jobs quickly.

    ReplyDelete
  2. qdel -u [user] can delete all queue tasks run by the same user. I find this helpful too.

    ReplyDelete
  3. Anonymous6:35 PM

    thanks for this short one :)

    ReplyDelete
  4. That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
    Security Services in Chennai

    ReplyDelete
  5. You can learn everything Internet shares about phone lookups and searching phone numbers online with different options, methods, and

    directions, have a look at weblink for more information.

    ReplyDelete
  6. Thank you so much for sharing this worth able content with us. The concept taken here will be useful for my future programs and i will surely implement them in my study. Keep blogging article like this.
    R Programming Online Training

    ReplyDelete