#!/bin/csh -f # # Replicates AIX files from the master to the backup server # in a HACMP environment # # Written by Kevin P. Inscoe (kevin@inscoe.org) - 1/20/1999 # # Global variables set RCPCMD = "/usr/lpp/ssp/kerberos/bin/rcp" set RSHCMD = "/usr/bin/rsh" set BACKUP_SERVER = "odcod2-int" set FILE_SETS = "/etc/passwd /etc/group /etc/opasswd /etc/ogroup /etc/security/passwd /etc/security/limits /etc/security/user /etc/security/ouser /etc/security/login.cfg /etc/profile /opt/bin/ondemand_start /opt/bin/ondemand_stop /opt/bin/ars_maint.sh /opt/bin/start_arsload.sh /opt/bin/nightly_backup.sh /opt/bin/ondemand_globals.sh /opt/bin/clean_archive.sh /opt/bin/dgsp /opt/bin/tdgsp /opt/bin/ito_msg_gen /opt/bin/checkin_optical.sh /opt/bin/nightly_cleanup.sh /var/spool/cron/crontabs/root" set TREES = "/home /usr/lpp/ars/client" set dtmp = `/bin/date '+%H%M%S'` set tmp = /tmp/replicate_master_server_$dtmp.tmp # Announce ourselves /bin/echo "replicate_master_server.sh: replicating node" `/bin/hostname` "to node" $BACKUP_SERVER "at" `/bin/date` # Process individual filesets foreach fileset ( $FILE_SETS ) /bin/echo "Replicating" $fileset "at" `/bin/date` $RCPCMD $fileset `/bin/echo $BACKUP_SERVER`:$fileset end # Processes entriee directory trees foreach tree ( $TREES ) /bin/echo "Replicating" $tree "at" `/bin/date` /bin/tar cvf `/bin/echo $tmp` `/bin/echo $tree` /bin/echo "Copying replication of" $tree "to node" $BACKUP_SERVER "at" `/bin/date` $RCPCMD $tmp `/bin/echo $BACKUP_SERVER`:$tmp /bin/rm -f $tmp set command = "`/bin/echo $RSHCMD $BACKUP_SERVER` -l root /bin/tar xvf `/bin/echo $tmp`" /bin/echo "Applying replication (tar xvf) of" $tree "on node" $BACKUP_SERVER "at" `/bin/date` $command set command = "`/bin/echo $RSHCMD $BACKUP_SERVER` -l root /bin/rm -f `/bin/echo $tmp`" $command end # Time to bail! /bin/echo "replicate_master_server.sh: Completed replicating node" `/bin/hostname` "to node" $BACKUP_SERVER "at" `/bin/date`