Hi All,

We now have a Log file which has time stamps of all the scripts ran. It has start
time and end time. I now have a requirement to send mail to the Admin after the script finishes running.

Can some one help me with a Script which will send mail with Start time and
End time of the script by picking the lines from the below sample log or in any other way which i can tell my script to mail start and end time after it finish running?

swift.log


SWIFT Europe Update Starting for: 04/23/07 21:05:44
SWIFT Europe Update Ending for: 04/23/07 21:08:01
Swift NA Begining : 04/24/07 00:28:22
Swift NA Ending : 04/24/07 00:28:29
Swift AUS Begining : 04/24/07 00:59:17
Swift AUS Ending : 04/24/07 00:59:25

Thanks
Srikanth GR

If you are writing to the logfile in the following manner scriptname >> logfilename Then change it as follows (for a really quick fix): scriptname | tee -a logfilename | mailx -s "scriptname" email@address

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.