perlscript

Scanning the log files for last 30 minutes of data

吃可爱长大的小学妹 提交于 2019-12-12 03:17:29
问题 I have to write a shell/perl script to scan a log file for last 30 mins worth Data. The requirement is to schedule this script in Cron to run every 30 minutes and look for a error string. OS: Solaris Shell:Bash I have tried below script, but it has become too long and clumsy, do we have other way to make it a bit shorter? blogs=/opt/docs/datapower/prod/business.log slogs=/opt/docs/datapower/prod/system.log starttime=$(date +'%H') currmin=$(date +'%M') curdate=`date|cut -d' ' -f5` echo $(date)