-5

I have a file in one of my file server named 'root' in /var/spool/mail. This does not grow beyond 50 MB. I would need to increase that to 100 MB, so that it can store more logs.

Basically it's a sync log file which is very important for us. I'm not a linux techie however I tried with the truncate command, but that serves me a different purpose. I also went through multiple articles here, but I couldn't get the answer I want. Please help!

Thanks in advance!

1
  • 7
    Please be aware that /var/spool/mail/root is not a log file, but rather the mailbox for root. The majority of email messages are typically the email messages that get sent by by the cron daemon when a scheduled cron job generates standard output. I you want to properly log something, adjust the cron job to redirect the output you want to record to an actual log file.
    – HBruijn
    Apr 3, 2018 at 9:02

2 Answers 2

0

You should not be using this file for logs, this is not what this file is for. As @HBruijn pointed out, the /var/spool/mail/root file is actually a mailbox for the root user.

If you want to log something, send the log contents to a file in /var/log/<application name>.

0

If you are running sendmail you can alias root to a regular email account.

sudo vim /etc/aliases
-- or --
sudo nano /etc/aliases

remove the # (hash symbol) from the beginning of the line that says root and then edit the user name that follows it. I think default it will say: #root mark

Then when done editing the file, you can run: sudo newaliases

This only works for sendmail, I don't know if there is a way to redirect roots email for other MTA's.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .