I have created a simple script for find the error message from logs and added it on cron job file to get it by mail every 4hrs once.
That log file has time stamp, daily we will new logs. Now i am daily altering the date manually, so i need some assistance to fix it to change dates automatically.
This is the exact script
grep -i error /var/bv1to1_var/logs/bv03.bectondickinson.com/bvlog.out.20140905 | tee error_bv03.doc
I changed it as [/code]
grep -i error /var/bv1to1_var/logs/bv03.bectondickinson.com/bvlog.out.`date +\%Y\%m\%d` | tee error_bv03.doc
[/code]
Is it right, will it work !!!
---------- Post updated at 07:37 AM ---------- Previous update was at 07:35 AM ----------
Hi,
I have created a simple script for find the error message from logs and added it on cron job file to get it by mail every 4hrs once.
That log file has time stamp, daily we will new logs. Now i am daily altering the date manually, so i need some assistance to fix it to change dates automatically.
This is the exact script
grep -i error /var/bv1to1_var/logs/bv03.bectondickinson.com/bvlog.out.20140905 | tee error_bv03.doc
I changed it as
grep -i error /var/bv1to1_var/logs/bv03.bectondickinson.com/bvlog.out.`date +\%Y\%m\%d` | tee error_bv03.doc
Thanks for the confirmation.
It will work, tee wont affect the cron, its working for last few days and receiving attached file by mail regularly.
For this date issue, i can answer tomorrow only, i need to check the log mail to confirm the date update.
Thanks vbe...
---------- Post updated at 08:36 AM ---------- Previous update was at 08:34 AM ----------
$uname -a
SunOS 5.10 Generic_141414-09 sun4u sparc SUNW,Sun-Fire-V245