Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th April 2011, 15:51
davefrooney davefrooney is offline
Junior Member
 
Join Date: Apr 2011
Posts: 16
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
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fail2ban is doing nothing? rlischer Server Operation 16 29th June 2010 07:29
Chrome + Ubuntu + Flash player andor Desktop Operation 1 25th May 2010 16:59
Problems with my 'Perfect Server' chillifire Server Operation 3 6th January 2010 12:26
Xen amd64 kernel on Debian is i386??? computer_freak_8 Installation/Configuration 8 8th November 2009 17:00
Need help with fail2ban on centos 5.3 rlischer Installation/Configuration 3 14th August 2009 11:47


All times are GMT +2. The time now is 22:50.


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