# Sync Epel Repos for internal patch management # Created by admin # Last modified: 1-30-2016 #!/bin/bash # Get info about the current system OS_VER=`cat /etc/system-release-cpe |cut -d : -f5 |cut -c1` # should return value of redhat/centos etc DISTRO=`cat /etc/system-release-cpe |cut -d : -f3` # Use reposync command to sync EPEL repo reposync --arch=x86_64 -d --repoid=epel --norepopath --download_path=/var/www/html/repo/epel/${OS_VER}/x86_64/Packages/ # Log message when completed logger sync_repo EPEL v${OS_VER} package repo synced # Update repo metadata createrepo --workers=4 --update /var/www/html/repo/epel/${OS_VER}/x86_64/Packages # Log message when completed logger sync_repo Package repo metadata updated on el${OS_VER} repo server # Dump contents for versioning info maybe send to git or svn later if [ -d /var/www/html/repo/epel/${OS_VER}/x86_64/Packages/a ]; then ls -R /var/www/html/repo/epel/${OS_VER}/x86_64/Packages/*/*.rpm >> /var/www/html/repo/Package_Diff/epel-packages-"$(date '+%m-%d-%Y')".txt else ls /var/www/html/repo/epel/${OS_VER}/x86_64/Packages/ >> /var/www/html/repo/Package_Diff/epel-packages-"$(date '+%m-%d-%Y')".txt fi