Created
September 29, 2016 16:53
-
-
Save smbambling/28b3425f263b564ace3736e88a4921e8 to your computer and use it in GitHub Desktop.
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/sh | |
# This file is managed by Puppet. | |
# Any changes will be lost. | |
# This is the rsync script to manage <%= @repository %> | |
# Logging | |
DATE=`/bin/date +%Y-%m-%d` | |
CONFFILE='/etc/yum.repos.d/<%= @repository -%>.repo' | |
OUTDIR='<%= @log_directory %>' | |
[ -d $OUTDIR ] || mkdir -p $OUTDIR | |
OUTFILE=$OUTDIR/<%= @repository %>-mirror-$DATE.txt | |
/bin/nice /usr/bin/reposync --norepopath -r <%= @repository %> -p <%= @docroot %><%= @repository %>/RPMS -d -c ${CONFFILE} >> $OUTFILE 2>&1 | |
RC=$? | |
# Run createrepo to create/update the yum metadata | |
if [ ${RC} = 0 ]; then | |
/usr/bin/createrepo <%= @docroot %><%= @repository %> >> $OUTFILE 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment