Paul Wagner
2018-10-30 13:37:01 UTC
Dear bashers,
I am trying to create a simple script to schedule wget to grab radio
programmes. Since I occasionally lose the connection, I ended up with
something like
function job() {
i=0
while true
do
i=$((i+1))
wget -a "$name.log" -O "$name-$i.mp3" "$url"
done &
sleep $length
kill %
}
while true
do
t=$(date '+%M %H')
while read startmin starthour length url name
do
[[ $t == $startmin' '$starthour ]] && job &
done < conf-file
sleep 60
done
Unfortunately, the kill does not end wget. What am I missing?
Kind regards,
Paul
I am trying to create a simple script to schedule wget to grab radio
programmes. Since I occasionally lose the connection, I ended up with
something like
function job() {
i=0
while true
do
i=$((i+1))
wget -a "$name.log" -O "$name-$i.mp3" "$url"
done &
sleep $length
kill %
}
while true
do
t=$(date '+%M %H')
while read startmin starthour length url name
do
[[ $t == $startmin' '$starthour ]] && job &
done < conf-file
sleep 60
done
Unfortunately, the kill does not end wget. What am I missing?
Kind regards,
Paul