# Script Name: /dir/scr.sh
#! /usr/bin/ksh
DATE=`date "+DATE:%m.%d.%y"`
> /tmp/$DATE
echo "Details of Last Succesfull Logins are Below:" >>/tmp/$DATE
aw=`date | awk '{print $1,$2,$3}'`
last | grep "$aw" >> /tmp/$DATE
echo "Details of Last Failed Logins are Below:" >>/tmp/$DATE
lastb | grep "$aw" >> /tmp/$DATE
cat /tmp/$DATE | mailx -s "Todays Details"
abc@def.gh
#Script End
Set this script to crontab
#crontab -e
0 18 * * * /dir/scr.sh
Cheers,
Awadhesh Pandey