Instantly share code, notes, and snippets.

Embed
What would you like to do?
wtf repo
### LS of Current working RHEL-6 yum repo:
ls -lah /yumrepo
auto-update.sh rhel-6-server-eus-optional-rpms rhel-6-server-extras-rpms rhel-6-server-rhs-client-1-rpms rhel-6-server-supplementary-rpms rhel-server-rhscl-6-rpms
lost+found rhel-6-server-eus-rhn-tools-rpms rhel-6-server-fastrack-rpms rhel-6-server-rhv-4-agent-rpms rhel-6-server-thirdparty-oracle-java-rpms rhel-sjis-for-rhel-6-server-eus-rpms
repodata rhel-6-server-eus-rpms rhel-6-server-optional-rpms rhel-6-server-rpms rhel-6-server-v2vwin-1-rpms
repo.list rhel-6-server-eus-satellite-tools-6.1-rpms rhel-6-server-rh-common-rpms rhel-6-server-sam-rpms rhel-server-dts2-6-rpms
repo.list.MORE rhel-6-server-eus-satellite-tools-6.2-rpms rhel-6-server-rhev-agent-rpms rhel-6-server-satellite-tools-6.1-rpms rhel-server-dts-6-rpms
rhel-6-server-cf-tools-1-rpms rhel-6-server-eus-supplementary-rpms rhel-6-server-rhn-tools-rpms rhel-6-server-satellite-tools-6.2-rpms rhel-server-rhscl-6-eus-rpms
### LS of New Repo I've just tried to set up... RHEL-7
Starting reposync -d -n
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Loaded plugins: product-id
Completed
Starting createrepo --update
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
Completed
ls
auto-update.sh lost+found repodata
### My auto-update.sh script...
#!/bin/bash
#########################################################
# Script to update yum repo and local system #
#########################################################
#
#
CURDATE=`date +%y%m%d-%H%M` # get date for log filename
LOGPATH=/var/log/yum/ # log path
LOCKFILE=/rhel-7-yumrepo/auto-update.lck
#
# export proxy environment setting
export HTTP_PROXY=OURPROXY
#
# redirect stdout and stderr to log file
exec &> >(tee $LOGPATH/auto_update_rhel-7_$CURDATE.log)
#
# create lock file if it doesn't exist and check ssh connection to warm site
cd /rhel-7-yumrepo
if [ ! -e $LOCKFILE ]; then
touch $LOCKFILE
# update repo
/bin/echo 'Starting reposync -d -n'
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-cf-tools-1-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-optional-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-rhn-tools-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-satellite-tools-6.1-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-satellite-tools-6.2-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-eus-supplementary-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-extras-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-fastrack-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-optional-fastrack-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-optional-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rh-common-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rhev-agent-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rhn-tools-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rhs-client-1-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rhv-4-agent-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-sam-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-satellite-tools-6.1-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-satellite-tools-6.2-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-supplementary-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-thirdparty-oracle-java-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-7-server-v2vwin-1-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-server-dts-7-rhb-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-server-dts-7-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-server-dts2-7-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-server-rhscl-7-eus-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-server-rhscl-7-rpms
/usr/bin/reposync -d -n --gpgcheck -l -p /rhel-7-yumrepo --repoid=rhel-sjis-for-rhel-7-server-eus-rpms
/bin/echo 'Completed'
sleep 5
#
# update repo
/bin/echo 'Starting createrepo --update'
/usr/bin/createrepo --update /rhel-7-yumrepo
/bin/echo 'Completed'
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment