This is what I have as my script for testing on a public mirror. It does not yet point to the master server.
#!/bin/bash
echo "--BEGINNING REPOSITORY SYNC AT `date`--"
if [ -f /var/lock/subsys/rsync_updates ]; then
echo "Updates via rsync already running."
echo "--ERROR: REPOSITORY SYNC ABORTED AT `date`--"
exit 0
fi
if [ -d /share/linux-os/centos/ ] ; then
echo "--SYNCING CentOS REPOSITORY, PLEASE WAIT--"
touch /var/lock/subsys/rsync_updates
time rsync -avSHP --delete /" --exclude "HEADER.html"" --no-motd mirror.us.oneandone.net:centos /share/linux-os/centos/
/bin/rm -f /var/lock/subsys/rsync_updates
echo "--CentOS REPOSITORY SYNC FINISHED AT `date`--"
else
echo "Target directory /share/linux-os/centos/ not present."
echo "--ERROR: REPOSITORY SYNC ABORTED AT `date` --"
fi
This is the output that it gives me.
[root@mirrors ~]# ./test.sh
--BEGINNING REPOSITORY SYNC AT Wed Feb 25 10:19:16 EST 2015--
--SYNCING CentOS REPOSITORY, PLEASE WAIT--
Unexpected remote arg: mirror.us.oneandone.net:centos
rsync error: syntax or usage error (code 1) at main.c(1201) [sender=3.0.6]
real 0m0.002s
user 0m0.000s
sys 0m0.002s
--CentOS REPOSITORY SYNC FINISHED AT Wed Feb 25 10:19:16 EST 2015--