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


22 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. you can select jobs based on a variety of criteria using qselect and pipe them to qdel with xargs e.g.

    qselect -u | xargs qdel

    to delete all jobs of a given user, -s R selects jobs with the state running, see the qselect docs for more refined selections.

    ReplyDelete
  5. Really Good blog post.provided a helpful information.keep updating...
    Digital marketing company in Chennai

    ReplyDelete
  6. This type of job seeker is already directly known by the organisation, normally through being an existing employee. Free Job Alert

    ReplyDelete
  7. However, it is possible to become employed in far fewer job applications than 200 made over four months, the current statistics for the average job seeker.Schoolnews

    ReplyDelete
  8. You need to test that the job market is offering that job at the right pay level, and this is where the real advantage of the jobs board driven job search becomes apparent.This blog

    ReplyDelete
  9. After reading this blog, I can say that another great writer in the making already.
    https://www.resumeyard.com

    ReplyDelete
  10. Ausgezeichnete Seite Ich mag es Mehr erfahren

    ReplyDelete
  11. Ausgezeichnete Seite Ich mag es Mehr erfahren

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Within the third party option is two types as well. You can have a retained job recruiter that receives payment up front for the work or you can have a contingent recruiter that only receives payment after the position has been filled. abroadjobsineurope.in

    ReplyDelete
  15. The result of this approach is a testament to their clear personal elevator pitch and track record of delivery, and the advocation by others often within the employing organisation, or by people within a common mutual network. Online Jobs

    ReplyDelete
  16. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info!

    software testing course in chennai

    ReplyDelete
  17. New web site is looking good. Thanks for the great effort. go

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. We now know some of the harmful effects that our pollution has produced. It is time to take corrective action, and that means considering cleaner modes of doing business get recruited..

    ReplyDelete
  20. Much as though I may think that candidate A may be better, the employer hiring manager may like the equally good candidate B better - it's just human chemistry!Govt job in odisha

    ReplyDelete