Sometimes you need to have Rocky repositories local for building virtual machines, lab environments, etc. It can also help save bandwidth if that is a concern. This article will walk you through using rsync to copy Rocky repositories to a local web server. Building a web server is out of the scope of this short article.
This simple shell script uses rsync to pull repository files from the nearest mirror. It also utilizes the "exclude" option which is defined in a text file in the form of keywords that should not be included. Excludes are good if you have limited disk space or just do not want everything for whatever reason. We can use * as a wildcard character. Be careful using */ng as it will exclude anything that matches those characters. An example is below: