Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Last active February 7, 2023 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tuxfight3r/16d586f125c0e2640f26 to your computer and use it in GitHub Desktop.
Save tuxfight3r/16d586f125c0e2640f26 to your computer and use it in GitHub Desktop.
Centos-updates x86_64 Mirror via wget behind proxy
#!/bin/bash
#Purpose:To Mirror Centos Updates x86_64 repo to local folder via
#squid proxy and also to update it periodically
#Author:Mohan
#export the squid proxy server
export http_proxy=192.168.2.100:3128
REPO_URL='http://mirror.centos.org/centos-6/6.5/updates/x86_64/Packages/'
wget -mk -nH --no-parent --cut-dirs=3 -R 'index.html*' -e robots=off $REPO_URL
#OPTIONS
# -mk mirror with -r -N -l
# -nH no host directories
# --no-parent no parent domain directory
# --cut-dirs=3 cut 3 directory levels on local repo
# -R 'index.html*' reject all index.html* files
cd x86_64
echo "updating the Repository Meta Data"
createrepo -v --update .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment