#!/bin/sh VERSION=1.0.0 echo -e "\t${SourceDevice} to ${DestDevice}" if [ "${Flag}" != "ALL" ]; then PATH="$PATH:/usr/local/bin:/sbin" export PATH /usr/local/bin/lcdman "/backups SyncInd." "Do Not Remove" . /etc/default/bp.ini 2>/dev/null else /usr/local/bin/lcdman "/backups Sync" "Do Not Remove" fi [ -d /mirror/backups ] || mkdir -p /mirror/backups [ "${Flag}" == "ALL" ] && \ $BPDIR/bin/bputil -j 0 "Synchronization /backups in progress:" # Fsck the mirrored /backups file system [ "${Flag}" == "ALL" ] && \ echo "Performing /mirror/backups fsck (filesystem Check)" >> $SYNCSTATUS umount /mirror/backups 2>/dev/null [ "${Flag}" == "ALL" ] && \ $BPDIR/bin/bputil -j 0 "Filesystem check of /mirror/backups:" grep -v "^#" /etc/fstab | awk ' $3 == "xfs" { print $1,$2 } ' | while read BlockDevice MountPoint do if [ "${MountPoint}" = "/mirror/backups" ] then xfs_repair ${BlockDevice} break fi done mount /mirror/backups if [ $? -eq 0 ]; then [ "${Flag}" == "ALL" ] && \ $BPDIR/bin/bputil -j 0 "Rsync /backups => /mirror/backups:" tar zcvf /tmp/config.tgz `cat /usr/local/bin/configlist.txt` /bin/nice rsync -avlxH --delete /backups/ /mirror/backups cp /tmp/config.tgz /mirror/backups rm -f /tmp/config.tgz fi umount /mirror/backups # mbe # Add call to LCD to display Sync complete message # mbe # Leave this message displayed for 1 minuite, then # mbe # restore the default display. # if [ "${Flag}" != "ALL" ]; then /usr/local/bin/lcdman "SyncInd complete." "Ready" sleep 10 /usr/local/bin/lcdman "Unitrends DPU" "Generation III" fi