Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a crontab task running every 5 minutes. It writes an output (result of the .sh file run by the crontab) to the /var/spool/mail/user. Should I be worried that this spooler will build up and slow down the system over time? Do these entries ever get cleared out? Are they only temporary? If possible, can I disable it.

share|improve this question

migrated from Jan 3 '12 at 21:35

This question came from our site for professional and enthusiast programmers.

This is a question about what it takes to program safely on Unix. It is on topic for SO. – Jonathan Leffler Jan 3 '12 at 20:41
I hope the output written by the crontab task is formatted as a valid e-mail message. If it isn't, you're messing up the user's e-mail inbox. – Keith Thompson Jan 3 '12 at 21:16

The messages stay there until the user whose mail it is reads and deletes the mail. That might be years later (I kid you not!).

  • No, the directory is not cleared out by anything.
  • Yes, you need to be worried about the problem of filling up your disk with unread email.
share|improve this answer
A possible solution might be to forward your mail to some email address that you really are reading. Another would be to redirect in your crontab the stdout & stderr outputs. If they are redirected or empty, crond won't send any email. – Basile Starynkevitch Jan 3 '12 at 20:50
To send the email to another email address in your crontab edit it and add a line similar to this: – kaptk2 Jan 3 '12 at 22:29

The contents of the /var/spool/mail/user directory remain until the user deletes the mail. You may wish to install a script that runs via cron to remove files older than a certain date, and tweak this as you monitor your system.

share|improve this answer
Don't do this without notifying your users well in advance. I would consider an automated script that deletes my e-mail to be hostile. – Keith Thompson Jan 3 '12 at 21:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.