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

Hi,

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.

Code:
#!/bin/bash

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

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