CentOS and many other distribution have a mail server already installed, since some processes use mail to send messages to the system administrator or to the crontab owners. Therefore you can simply do something like:
Code:
(
echo "From: Sender <sender@domain>"
echo "To: Recipient <recipient@domain>"
echo "Subject: This is log of today $(date)"
cat file.log
) | /usr/sbin/sendmail "recipient@domain"
If you prefer to send the log as attachment, you can try mutt or uuenview. Example:
Code:
/usr/bin/uuenview -m "recipient@domain" -f "sender@domain" -s "This is log of today $(date)" -a file.log <<-EOF
Log in attachment.
Greetings,
Me
EOF
The
uuenview command is provided by the
uudeview package.