I have a daemon that executes some commands every two days. When it encounters any error, I want it to notify me. I know that bash can look up the /var/mail/user
and tell me if there any new messages in this file. But I never used messages before. I think I have to use the mail
command to do that.
However when I try to look up information about the usage of the command, I only read about sending actual emails, not local messages to users. So how would I send a message to myself, so that when I execute mail
I'd get You have new mail
.