Last active
February 7, 2023 02:33
-
-
Save tuxfight3r/16d586f125c0e2640f26 to your computer and use it in GitHub Desktop.
Centos-updates x86_64 Mirror via wget behind proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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