I currently have logrotate rotating my logs once a day via a cron job. I would like to set it up to email me as well. I installed postfix.
I have tested to send mail from the command line with this line and it works fine:
Code:
echo -e "subject: Test Email\nJust testing\n." | sendmail -t john@email.com
From the logrotate man, the default mail command is /bin/mail -s. I checked my system and there is no such command, so I am using the -m switch to substitute my own mail command. I have modified my cron job to the following but am still having problems with mail
Code:
/opt/sbin/logrotate -m 'sendmail -t john@email.com' /opt/etc/logrotate.conf
Code:
/opt/sbin/logrotate -m 'echo -e "subject: Test Email\nJust testing\n." | sendmail -t john@email.com' /opt/etc/logrotate.conf
Thanks.