Skip to content

Instantly share code, notes, and snippets.

@khsing
Created August 14, 2009 07:28
Show Gist options
  • Save khsing/167694 to your computer and use it in GitHub Desktop.
Save khsing/167694 to your computer and use it in GitHub Desktop.
#!/bin/sh
cd `dirname $0`
LOG=/tmp/yummirror.log
echo "Start at:: `date \"+%Y-%m-%d %H:%M:%S\"`" > $LOG
for os_ver in 4 5;do
for os_arch in i386 x86_64;do
for centos_repo in os updates;do
mkdir -pv centos/$os_ver/$centos_repo/$os_arch 2>&1 >> $LOG
rsync -rtv rsync://ftp.heanet.ie/pub/centos/RPM-GPG-KEY-CentOS-$os_ver centos/ 2>&1 >> $LOG
rsync -rtv rsync://ftp.heanet.ie/pub/centos/$os_ver/$centos_repo/$os_arch centos/$os_ver/$centos_repo/ 2>&1 >> $LOG
done
mkdir -pv epel/$os_ver/$os_arch 2>&1 >> $LOG
rsync -rtzv rsync://ftp.heanet.ie/pub/fedora/epel/$os_ver/$os_arch epel/$os_ver/ 2>&1 >> $LOG
done
done
rsync -rtv rsync://ftp.heanet.ie/pub/fedora/epel/RPM-GPG-KEY-EPEL epel/ 2>&1 >> $LOG
echo "Stop at:: `date \"+%Y-%m-%d %H:%M:%S\"`" 2>&1 >> $LOG
cat $LOG | mail -s "`date \"+%Y-%m-%d %H:%M:%S\"` Mirror log for epel " [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment