wget command help to download packages from mirror


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting wget command help to download packages from mirror
# 1  
Old 11-30-2010
wget command help to download packages from mirror

Index of /distribution/openSUSE-stable/repo/oss/suse/i586

How can i download packages with wget from that mirror with a string "alsa"?
Such as:
alsa-1.0.23-2.12.i586.rpm
alsa-devel-1.0.23-2.12.i586.rpm
alsa-oss-1.0.17-29.2.i586.rpm


Not manually downloading packages.
But i'm trying to download packages that has a string/word "alsa".
wget will automatically download those packages.

How can it be done?

Any script?
# 2  
Old 11-30-2010
Hint Smilie
Code:
lynx -dump http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/ | grep -i alsa

# 3  
Old 11-30-2010
Quote:
Originally Posted by cabrao
Hint Smilie
Code:
lynx -dump http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/ | grep -i alsa

Can't get it.
# 4  
Old 11-30-2010
Try this:
Code:
mirror="http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/"
lynx -dump $mirror | awk '/http.*alsa.*\.rpm$/ {print "wget -c "$2 | "sh"}'


Last edited by cabrao; 11-30-2010 at 11:00 AM..
# 5  
Old 11-30-2010
Quote:
Originally Posted by cabrao
Try this:
Code:
mirror="http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/"
lynx -dump $mirror | awk '/http.*alsa.*\.rpm$/ {print "wget -c "$2 | "sh"}'

Does not work.
# 6  
Old 11-30-2010
As far as I know wget does not support HTTP globbing. You can try something like:

Code:
#!/bin/ksh
URLS="$(wget -qO- http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/ | sed -n 's/.*<a href="\(.*alsa.*.rpm\)">.*/\1/p')"
for file in $URLS; do wget $file; done

# 7  
Old 11-30-2010
Quote:
Originally Posted by verdepollo
As far as I know wget does not support HTTP globbing. You can try something like:

Code:
#!/bin/ksh
URLS="$(wget -qO- http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/ | sed -n 's/.*<a href="\(.*alsa.*.rpm\)">.*/\1/p')"
for file in $URLS; do wget $file; done

The output has some problem, more files than the expect, such as pyalsa-1.0.22-1.8.i586.rpm.

Code:
#!/bin/ksh
MIRRORURL="http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/"
URLS="$(wget -qO- $MIRRORURL | awk -v RS=" " -F \" '/href=.*rpm\">/&&$2~/^alsa/{print $2}' )"
for file in $URLS; do wget $MIRRORURL/$file; done


Last edited by rdcwayx; 11-30-2010 at 08:55 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

2. Shell Programming and Scripting

Wget help - unable to download pic

There is a website providing traffic camera images that gets updated every few minutes. My aim is to download the images over time to get a view of traffic conditions through the day. Website: CHECKPOINT.SG Image link, as taken from site source: http://www.checkpoint.sg/sg/2701 I tried... (2 Replies)
Discussion started by: Leion
2 Replies

3. Shell Programming and Scripting

How to cancel wget download after 1%?

I am running a video download test and automating that. I wanna know how to stop a wget download session when downloads reached 1% Thanks in advance, Tamil (11 Replies)
Discussion started by: tamil.pamaran
11 Replies

4. Shell Programming and Scripting

Files download using wget

Hi, I need to implement below logic to download files daily from a URL. * Need to check if it is yesterday's file (YYYY-DD-MM.dat) * If present then download from URL (sample_url/2013-01-28.dat) * Need to implement wait logic if not present * if it still not able to find the file... (1 Reply)
Discussion started by: rakesh5300
1 Replies

5. Shell Programming and Scripting

[Solved] Wget command to download file

Hi I am trying to download the file using wget command. But The password was created as pwd$$ for the user xyz. When i give the command as below it is not downloading the file. Will the password has $$ causing this issue. wget... (0 Replies)
Discussion started by: ksmbabu
0 Replies

6. Shell Programming and Scripting

rsync mirror of download directory

I have a download directory for NDM Secure+ to receive files from other system. I need to mirror this directory to another box, but need to skip files that are still coming in. I have no control over file names or destination directories as they are configured on the sending side. How can I... (2 Replies)
Discussion started by: wskibum
2 Replies

7. UNIX and Linux Applications

download file using wget

I need to download the following srs8.3.0.1.standard.linux26_32.tar.gz file from the following website: http://downloads.biowisdomsrs.com/srs83_dist There are many gzip files along with the above one in the above site but I want to download the srs8.3.0.1.standard.linux26_32.tar.gz only from... (1 Reply)
Discussion started by: alphasahoo
1 Replies

8. Shell Programming and Scripting

download a particular file using wget

Hi All I want to download srs8.3.0.1.standard.linux24_EM64T.tar.gz file from the following website : http://downloads.biowisdomsrs.com/srs83_dist/ But this website contains lots of zipped files I want to download the above file only discarding other zipped files. When I am trying the... (1 Reply)
Discussion started by: alphasahoo
1 Replies

9. UNIX for Dummies Questions & Answers

Using wget to download a file

Hello Everyone, I'm trying to use wget recursively to download a file. Only html files are being downloaded, instead of the target file. I'm trying this for the first time, here's what I've tried: wget -r -O jdk.bin... (4 Replies)
Discussion started by: thoughts
4 Replies

10. UNIX for Dummies Questions & Answers

May download a folder using wget command!

Hi All, I think wget command would not download any directories. But please confirm it. If it downloads directories, please let me know how to do it. Thank you. (1 Reply)
Discussion started by: ThrdF
1 Replies
Login or Register to Ask a Question