Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


CRON email Management help, please
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

CRON email Management help, please

We have a couple of crons which run every hour on my centos server. Currently, all emails are going to the default use mailbox. I usually read the contents of the file by vi /var/spool/mail/myaccount and read it.

I installed mail/ mailx. However, there are close to 20k emails already in the inbox. Is there any email client I can use to sort through the messages?

What are some quick commands which can help me sort emails by date/ subject? Any help is appreciated

Thanks.

Comments

  • jarjar Patron Provider, Top Host, Veteran

    Silence your cron output. But if you want to view the emails try mutt.

  • @jarland said:
    Silence your cron output. But if you want to view the emails try mutt.

    I need the cron outputs. Mutt, Ill try.

  • I don't see how any of that is specific to cron output. The easiest way to get things in order is to probably install an IMAP server like dovecot and sort through it all with a GUI mail client.

  • drendren Member

    Do you need all the cron outputs, or can you silence some of them? There are generally ways to send outputs only under certain conditions to avoid alert fatigue.

  • @dren said:
    Do you need all the cron outputs, or can you silence some of them? There are generally ways to send outputs only under certain conditions to avoid alert fatigue.

    Can you share some pointers?

  • @impossiblystupid said:
    I don't see how any of that is specific to cron output. The easiest way to get things in order is to probably install an IMAP server like dovecot and sort through it all with a GUI mail client.

    can any normal GUI read system user email boxes? any suggestions? I installed MUTT, and it looks Ok for now.

  • drendren Member
    1. Tell crontab to send email with stderr but NOT stdout. If the script has issues, you'll still get a mail.
    2. If your code doesn't support e-mailing when there is problems that would not generate stderr ouput, then update your cron scripts to send out e-mails in this case.
  • raindog308raindog308 Administrator, Veteran

    dren said: Tell crontab to send email with stderr but NOT stdout. If the script has issues, you'll still get a mail.

    e.g.:

    [email protected]
    0 * * * *    /scripts/ddos_let.sh > /scripts/logs/ddos_let.out 2>&1
    0 * * * *    /scripts/ddos_let.sh > /scripts/logs/ddos_let.out
    

    MAILTO means all output will be mailed to that email.

    First job will send all its output to that log plus any error output. Complete silence.

    Second job will send only normal (stdout) output to that log. Any errors (stderr) output will go to email.

    Thanked by 2dren theroyalstudent
  • @plumberg said:
    can any normal GUI read system user email boxes?

    I don't understand the question. Set IMAP up to authenticate as the user's account (SSL connection highly suggested) and you're done. I don't even remember doing it, so that's probably the default configuration out of the box for dovecot. If you want to further manage accounts (e.g., so that different cron jobs mail different user accounts) that's totally up to you.

Sign In or Register to comment.