DNRMirror
21 Nov 2009 23:58 UTC 2009325+2358 UTC

Development Page--Not for Official Use

To mirror the DNR machine requires several items:

  1. rsync daemon running on dnr.cbi.tamucc.edu
  2. crontab entry on mirror machine to synchronize pobot
  3. crontab entry on mirror machine to synchronize cbidb and recreate stnattr.dat and the smcorr table
  4. crontab entry on mirror machine to synchronize clerk
  5. crontab entry on mirror machine to synchronize clerk/archive


The file /etc/rsyncd.conf (reproduced below) is a symlink to ~cbidb/etc/rsyncd.conf. This file allows anonymous rsync connections to DNR from specified hosts. The host pc173.cbi.tamucc.edu was used for testing and should be replaced with the name or IP of the actual mirror.

rsyncd.conf

	
# rsyncd.conf

[cbidb]
	path = /u3/cbidb
	read only
	exclude = var/alert/* var/log/* etc/*httpd.conf
	hosts allow = pc173.cbi.tamucc.edu

[clerk]
	path = /u3/clerk
	read only
	exclude = var/* archive/*
	hosts allow = pc173.cbi.tamucc.edu

[pobot]
	path = /u4/pobot
	read only
	exclude = var/* inbox/* pobotarc/*
	hosts allow = pc173.cbi.tamucc.edu

[clerk-archive]
	path = /u3/clerk/archive
	read only
	hosts allow = pc173.cbi.tamucc.edu


The following are the crontab entries and scripts used on the mirror machine to keep its database up-to-date.

/var/spool/cron/pobot

	
# rsync once a day
0 18 * * * /usr/bin/rsync -CWarxq dnr.cbi.tamucc.edu::pobot .

/var/spool/cron/clerk

	
# rsync software once a day
0 18 * * * /usr/bin/rsync -CWarxq dnr.cbi.tamucc.edu::clerk .

# rsync data every hour
0 * * * * bin/archive.mirror

~clerk/bin/archive.mirror

	
#!/bin/bash

ARCDIR=/u3/clerk/archive
INBOX=/u3/clerk/inbox
F=$(rsync -WHCarxv dnr.cbi.tamucc.edu::clerk-archive $ARCDIR | grep -e '^[0-9]'
)
for f in $F
do
   if [ ! -f $ARCDIR/$f ]; then continue; fi
   ln $ARCDIR/$f $INBOX
done
~clerk/bin/tnclerk

/var/spool/cron/cbidb

	
# rsync daily
0 18 * * * bin/cbidb.mirror

~cbidb/bin/cbidb.mirror

	
#!/bin/bash

cd $HOME
/usr/bin/rsync -CWarxq dnr.cbi.tamucc.edu::cbidb .
bin/mkstnattr
echo "drop table smcorr" | mysql -ucbidb -pcbidb cbidb
src/scripts/create_smcorr
src/scripts/import_smcorr var/smcorr.dat

< How To Order Dell | System Administration | Repair Degraded RAID Array >

Page last modified on July 02, 2008, at 12:36 PM