Skip to content

Instantly share code, notes, and snippets.

@hansode
Created October 28, 2011 08:40
Show Gist options
  • Save hansode/1321883 to your computer and use it in GitHub Desktop.
Save hansode/1321883 to your computer and use it in GitHub Desktop.
mirror part(s) of epel repository.
#!/bin/bash
pkg_keywords="^erlang|^wx"
rhel_ver=6
arch=x86_64
base_uri=http://download.fedora.redhat.com/pub/epel/${rhel_ver}/${arch}
wget_opts="-m --no-parent"
wget ${wget_opts} ${base_uri}/repodata/
w3m -dump ${base_uri}/ |\
awk '{print $1}' | egrep '\.rpm$' |\
egrep ${pkg_keywords} |\
while read rpm; do \
wget ${wget_opts} ${base_uri}/${rpm}
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment