![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| oracle background processes | vijayasawant | SuSE | 1 | 02-17-2009 02:44 PM |
| Question about background processes | neimaD | Linux | 10 | 09-10-2008 11:21 AM |
| Determine Number of Processes Running | wayne1411 | Shell Programming and Scripting | 4 | 12-17-2007 03:06 PM |
| Running two processes in background | jacob_gs | Shell Programming and Scripting | 6 | 05-13-2002 12:40 PM |
| Background processes | korndog | UNIX for Advanced & Expert Users | 2 | 09-20-2001 10:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
Keep a certain number of background processes running
I've got a bit of code I'm trying to work on... What i want to happen is ... at all times have four parallel mysql dump and imports running. I found the follow code snippet on the forum and modified it to work by starting four concurrent processes but it waits until all four are done before starting the next four... Code:
LIST='wmi_product wmi_patches employee actions jobs appversions os hardware detection_apps status wmi_networkadapterconfig wmi_logicaldisk'
let counter=0;
for i in $LIST
do
echo " Dumping and Importing table $i" " ( `date +'%x %X'` ) "
$MYSQLDUMP -h$DBHOST -u$USER -p$PASSWORD -q --opt --single-transaction --add-drop-table $DB --tables $i | $MYSQL -u$DBuser -p$DBpass $DB > $ilog.txt &
let counter=$counter+1
echo "$counter%4" | bc
if [ `echo "$counter%4" | bc` -eq 0 ] ; then
wait
fi
done;
Is there a way to do this? Any help would be appreciated. |
| Bookmarks |
| Tags |
| background, process management, scripting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|