3
四、 全面备份工作站数据
以下程序是对工作站全面数据的备份,包括机组运行画面的备份;机组 ICC 组态数据;软件程
序备份;和工作站其它杂项备份。此程序可以自己运行,也可以通过 autoback 进行调用。程序运行
界面如下:
程序的环境变量定义及准备:
#! /bin/sh
# File Name: back2hd
if [ $# -gt 0 ] ; then
echo "\tUsage: $0">/dev/null 2>&1
echo
exit 1
fi
;定义程序及备份数据存放位置;
TOOLDIR=/opt/backup/AW1001/tools
BACKDIR=/opt/backup/AW1001/BAK
TOOLDIR=/opt/backup/AW1001/tools
#Pick System Date to a File
echo "`date`\t\t File: $0 Run"|tee -a ${LOGFILE} >/dev/null 2>&1
if [ ! -d "$BACKDIR" ] ; then
mkdir ${BACKDIR}
fi
;定义变量while—do循环调用各子程序;
OPTION=99
DONE=1
while [ "$DONE" -gt 0 ]
do
case "$OPTION" in
0) DONE=0
;;
fi
;;
esac
done
;程序通过while—do循环以调用子程序运行进行数据备份,选择0、回车选项退出此循环,选择其
它数字调用其它程序,以下各子程序为循环内部:
4.1 备份 DCS 系统画面
选择 1,将显示“Backup Feixian Power Plant Unit #1 Files,Please Wait .............”
将进行机组运行画面及所需要的字库,函数备份。程序如下所示:
1) echo
echo "\t\t1 - Backup Feixian Power Plant Unit #1 Files"
echo "\n\t\tPlease Wait .............\n"
#Delete the core/crash and Before Tar FeiXian Display files;删除垃圾文件
find /opt/gdfx -name core > tmp
find /opt/gdfx -name *.i >> tmp
find /opt/gdfx -name *.g >> tmp
find /opt/gdfx -name *.m1>> tmp
cat tmp|while read FILE
do
rm -f ${FILE}
done