当备份成功时,使用下面示例的方法向 onbar 脚本添加命令来打印紧急引导文件。每次发出 onbar -b 命令时,都将打印紧急引导文件。
onbar_d "$@" # receives onbar arguments from command line return_code = $? # check return code # if backup (onbar -b) is successful, prints emergency boot file if [$return_code -eq 0 -a "$1" = "-b"]; then servernum=‘awk '/^SERVERNUM/ {print $2}' $GBASEDBTDIR/etc/$ONCONFIG ' lpr \$GBASEDBTDIR/etc/ixbar.$servernum fi exit $return_code