Thread: Root mail huge

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    269
    Rep Power
    21

    Root mail huge


    In doing some disk cleanup on CentOS, I just found that my /root/Maildir/new directory was 25G.

    Does anyone have advise on how to stop this from re-occurring?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,477
    Rep Power
    1752
    Yes, housekeeping!

    The user running cron jobs, etc., will get mailed when there is output from the job that would normally go to stdout or stderr. You may well have one or more cron jobs that regularly produces output which will send mails - backups are a prime example.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    269
    Rep Power
    21
    Originally Posted by SimonJM
    Yes, housekeeping!

    The user running cron jobs, etc., will get mailed when there is output from the job that would normally go to stdout or stderr. You may well have one or more cron jobs that regularly produces output which will send mails - backups are a prime example.
    Whats the best way to defeat this? Send the cron output to /dev/null ?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,477
    Rep Power
    1752
    Not immediately!
    What you do is have a trawl through the mails, identify the 'regular offenders' and why they are doing it. If it's 'just' log information of no use then redirect that output to either a fixed file (for each task) so they can be reviewed on a daily basis, or to /dev/null.
    If the information is needed, then redirect the output to a file that will either be appened to or contain the run date/time, so that can be reviewed.
    Log files will, of course, tale up space so if you redirect all the putput to log files you'll just be moving the problem from one file system/directory to another.
    That's why you go through the mails (probaly only really need the last months) to get a decent representation of what is being output and why and then deal with that. Then you keep an eye on the mail root files and perform the above steps for any more output previously missed.
    Rinse and repeat. Wax on, wax off ...
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo