HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Set limit on jobs based on process name? (http://www.howtoforge.com/forums/showthread.php?t=52211)

davefrooney 8th April 2011 15:51

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


All times are GMT +2. The time now is 19:08.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.