View Single Post
Old 8th April 2011, 16:51
davefrooney davefrooney is offline
Junior Member
Join Date: Apr 2011
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set limit on jobs based on process name?


I am looking to limit the number of concurrent jobs run based on process name.

I am running audio conversion on a server using pacpl with the following script but it isnt limiting jobs like i want it to.


num_jobs = 13
while [ $(ps -A | grep -v grep | grep -c pacpl) -ge $num_jobs ]
        sleep 1

pacpl -t mp3 --outdir /my/out/dir $1 >> /var/log/pacpl/34.log &
Any help would be greatly appreciated
Reply With Quote
Sponsored Links