Created
October 18, 2018 18:43
-
-
Save sebastiaanfranken/0088c2248f9c3d92ac3e015465c139f4 to your computer and use it in GitHub Desktop.
Update a yum mirror with reposync and createrepo
This file contains hidden or 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 | |
# Which repos should we sync? You can edit this list to your | |
# hearts content. The values it accepts can be checked with | |
# the "$ yum repolist" command. Make sure you have yum-utils | |
# installed, first. | |
REPOS="base updates extras epel" | |
# Loop over the repos defined above and reposync them all, | |
# followed by a createrepo. | |
for REPO in $REPOS; do | |
/usr/bin/reposync --repoid=$REPO -g -l -n -p /var/www/html/repos/centos/7/ | |
/usr/bin/createrepo /var/www/html/centos/7/$REPO | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment