1
    0 0 * * 6 /usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit Reports of my server" myemail@example.com

I already navigated to the /usr/sbin directory and ran chkrootkit using sudo. That produces an output which is fine. However, I tried running mail -s "Subject" myemail@example.com separately in the terminal and that does not send any email to my account. How do i configure 'mail' to send an email to my email address? I did a "whereis mail" command in the terminal and it yielded these results: mail: /usr/bin/mail.mailutils /usr/bin/mail /usr/share/man/man1/mail.1.gz

1
  • 3
    I suggest you change the title of your question. Your actual question is how to set up local email delivery, it has nothing to do with cron at all. The wrong title and tag means that people that know about cron will take a look and go away while people that could help you with the email setup will skip the question, thinking it's about cron. Jun 19 '20 at 14:39
0

However, I tried running mail -s "Subject" myemail@example.com separately in the terminal and that does not send any email to my account.

Seems you've tagged Ubuntu for this issue. On your distribution of Ubuntu you will need to have mail installed (more specifically, mailutils). You'll end up with a smattering of MTA (mail transport agent) and MUA (mail user agent) packages.

Over all you'll want to apt install mailutils and run through the configuration prompts. Once you've completed the configuration, you should be able to mail -s "Subject" you@yourstuff.com. If you find that you still can't, let us know.

It would be helpful to know what specific Ubuntu distribution you are using, so we can better provide links to potential issues that may come up when you're installing. Additionally, please try to tailor your title to more accurately reflect the issue at hand - it seems you're having a problem with mail specifically, and not cron. This makes a big difference in getting eyes on your problem!

1
  • Thank you for the advice I will try to my question more specific. I appreciate the feedback @Kahn
    – Abdul Khan
    Jun 20 '20 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.