Okay, here it is:
#!/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/CentOS/6.3 ] ; then echo "--SYNCING CentOS REPOSITORY, PLEASE WAIT--" touch /var/lock/subsys/rsync_updates time rsync -avSHP --delete --exclude "6.2/" --exclude "isos/" --exclude "HEADER.html" --no-motd rsync.gtlib.gatech.edu::centos /share/CentOS/ /bin/rm -f /var/lock/subsys/rsync_updates echo "--CentOS REPOSITORY SYNC FINISHED AT `date`--" else echo "Target directory /share/CentOS/6.3 not present." echo "--ERROR: REPOSITORY SYNC ABORTED AT `date`--" fi
Hope this helps.
On Thu, Feb 28, 2013 at 1:02 PM, Tony Schliesser tony@schliesser.orgwrote:
Ryan - If you don't care to share your mirror script, I'd like to see it.
Thanks, Tony
Hi Jim, it's quite easy to do with a script. This first section here checks to see if a lock is present, and if it is, the script bails:
if [ -f /var/lock/subsys/rsync_updates ]; then echo "Updates via rsync already running." echo "--ERROR: REPOSITORY SYNC ABORTED AT `date`--" exit 0 fi
When I begin my sync, it touches the lock file (touch /var/lock/subsys/rsync_updates), and when finished, removes it (/bin/rm -f /var/lock/subsys/rsync_updates). If you need any help or wish to see my full script, just let me know and I can provide it.
On Wed, Feb 27, 2013 at 8:42 PM, Jim Hartnett mirrors@gawsolutions.uswrote:
Ok, I have the lock scripts setup and working, I think we're ready to add our mirror.
(information repeated):
mirror Url: http://mirrors.gawsolutions.us/centos bandwidth: 100 Mbps up/down unmetered transfer located in dallas, tx, usa Geeks at Work Solutions centos machine with apache rsync twice a day at offset minutes (reduces peak for even hour starts)
- -Jim
P.S: sorry if this message gets repeated multiple times. I just found out my email client was having some issues with the account I use for mirror mailing lists
CentOS-mirror mailing list CentOS-mirror@centos.org http://lists.centos.org/mailman/listinfo/centos-mirror
Thanks. I do not run a mirror but I do a fair amount of bash scripting and like seeing others code as I always seem to learn something. Thanks for sharing.
Tony
On Feb 28, 2013, at 16:02, Ryan Becker Ryan@techbnc.org wrote:
Okay, here it is:
#!/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/CentOS/6.3 ] ; then echo "--SYNCING CentOS REPOSITORY, PLEASE WAIT--" touch /var/lock/subsys/rsync_updates time rsync -avSHP --delete --exclude "6.2/" --exclude "isos/" --exclude "HEADER.html" --no-motd rsync.gtlib.gatech.edu::centos /share/CentOS/ /bin/rm -f /var/lock/subsys/rsync_updates echo "--CentOS REPOSITORY SYNC FINISHED AT `date`--" else echo "Target directory /share/CentOS/6.3 not present." echo "--ERROR: REPOSITORY SYNC ABORTED AT `date`--" fi
Hope this helps.
On Thu, Feb 28, 2013 at 1:02 PM, Tony Schliesser tony@schliesser.org wrote:
Ryan - If you don't care to share your mirror script, I'd like to see it.
Thanks, Tony
Hi Jim, it's quite easy to do with a script. This first section here checks to see if a lock is present, and if it is, the script bails:
if [ -f /var/lock/subsys/rsync_updates ]; then echo "Updates via rsync already running." echo "--ERROR: REPOSITORY SYNC ABORTED AT `date`--" exit 0 fi
When I begin my sync, it touches the lock file (touch /var/lock/subsys/rsync_updates), and when finished, removes it (/bin/rm -f /var/lock/subsys/rsync_updates). If you need any help or wish to see my full script, just let me know and I can provide it.
On Wed, Feb 27, 2013 at 8:42 PM, Jim Hartnett mirrors@gawsolutions.us wrote:
Ok, I have the lock scripts setup and working, I think we're ready to add our mirror.
(information repeated):
mirror Url: http://mirrors.gawsolutions.us/centos bandwidth: 100 Mbps up/down unmetered transfer located in dallas, tx, usa Geeks at Work Solutions centos machine with apache rsync twice a day at offset minutes (reduces peak for even hour starts)
- -Jim
P.S: sorry if this message gets repeated multiple times. I just found out my email client was having some issues with the account I use for mirror mailing lists
CentOS-mirror mailing list CentOS-mirror@centos.org http://lists.centos.org/mailman/listinfo/centos-mirror
CentOS-mirror mailing list CentOS-mirror@centos.org http://lists.centos.org/mailman/listinfo/centos-mirror
I used to hosting a mirror. You can take a look at repoforge.org's instructions. Its page provides a useful command.
I also write something on my blog, but unfortunately, it's in Chinese. ;)