Reputation: 10844
We schedule cron jobs on a ubuntu server 10.04, the scripts that we execute contains the commands maven clean package & then execute a java class.
The email alert report after the job completion is verbose, The email is pretty lengthy detailing all the actions taken. In the email i just want few last lines, and if the job fails then the detailed error report.
One option i have is to store the result in a log file, and tail the output. But if the jobs fails i may not get the complete report.
Can i do this using some other java class or any other alternatives.
Any tips/advise is appreciated.
-- Thanks
Upvotes: 0
Views: 198
Reputation: 4452
Write a perl/shell script to process the log file and then call that script as a cron-job. Write the script in such a way that, if the job passes, it extracts the last few lines alone (may be, using the tail
command), and if the job fails, output the entire file). I'm not sure if this is what you are looking for, but this was what I did, when I faces a similar situation.
Upvotes: 1