Guest User

Untitled

a guest
Oct 20th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. maxjobs=10
  4. running=0
  5.  
  6. doit() {
  7. while read host source target ; do
  8.         ssh root@$host "./valamit-csinalunk $source $target" &
  9.  
  10.         running=$(($running+1))
  11.  
  12.         if [ "$running" -ge $maxjobs ]; then
  13.                 wait
  14.                 running=0
  15.         fi
  16. done
  17. wait
  18. }
  19.  
  20. cat replication.cfg | doit
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment