#!/bin/bash
PATH1=/mnt/tempdisk3
cd $PATH1
PATH1=/mnt/tempdisk3
cd $PATH1
count=1
for file in $(awk '{print $1}' /mnt/tempdisk3/to_wenming_url_list)
do
url=`awk '/'"$file"'/{print $2}' /mnt/tempdisk3/to_wenming_url_list`
F=$[($count)%19]
mkdir -p $PATH1/data/$F
wget -c -O $PATH1/data/$F/$file.mp3 $url &
pscount=$(ps -ef |grep -v "grep" | grep -c wget)
until [ $pscount -le 5 ]
do
sleep 2
pscount=$(ps -ef |grep -v "grep" | grep -c wget)
done
(( count=count+1 ))
done
#------------------------------
由于源文件mp3量太大,都放一个目录效率不高,用%取膜方式建19个目录 然后存到各个目录里
wget 进程载控制在5个(可以自己调).