提取oralce当天的alert log的shell脚本
#/bin/sh
#get alert of everyday
#then name of file is everyday_alert.sh
dir="/oracle/admin/bbdz/bdump"
num=$(cat -n ${dir}/alert_bbdz.log | grep "`date|cut -c 1-10`"|head -n 1 |awk '{print $1}')
tail +${num} ${dir}/alert_bbdz.log >>/oracle/admin/bbdz/alert/alert_bbdz_`date + '%Y%m%d'`.log
设定执行计划
crontab -e
58 23 * * * sh /oracle/script/every_alert.sh