Operating System - HP-UX
1747985 Members
5012 Online
108756 Solutions
New Discussion юеВ

Re: How to check what is writing to /var/mail/root

 
f. halili
Trusted Contributor

How to check what is writing to /var/mail/root

I have a machine with /var/mail/root filling up fast. I checked the cron and did not find any. How can I tell which script ran that send to root's mail? Or how can I identify what is writing to /var/mail/root at the moment?

Thanks,
f. halili
derekh
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: How to check what is writing to /var/mail/root

Did you check the contents of the /var/mail/root file itself?

If it is mail messages, then the messages themselves should yield some clue as to what is creating them.
James R. Ferguson
Acclaimed Contributor

Re: How to check what is writing to /var/mail/root

Hi:

Remember that any un-redirected output (STDOUT or STDERR) from a cron job will automatically generate mail to the process user.

If you have mail for the root user, I would think you should be able to match the contents to a crontask.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: How to check what is writing to /var/mail/root

root's email is not something you should ignore. Your system has a problem and you should be reading it to determine what is wrong. Use elm or if you are not familiar with elm, use tail:

tail -500 /var/mail/root

You of course need a terminal emulator that will remember 20-40 pages of text so you can scroll back to look at the messages. The messages will tell about the problem.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: How to check what is writing to /var/mail/root

>Bill: Use elm or if you are not familiar with elm, use tail:

You can also use mailx.
# mailx
? fold (tells you how many messages)
? h $ (goes to the end)
? t message-number
? x (quit with no changes)
Horia Chirculescu
Honored Contributor

Re: How to check what is writing to /var/mail/root

Hello,

root's mail is very important. A lot of useful information you can get from there.

In this file:

/etc/mail/aliases

You can find out what aliases are defined for root account. Some of those aliases are used by the system in order to send messages generated by some daemons.

Horia.
Best regards from Romania,
Horia.
f. halili
Trusted Contributor

Re: How to check what is writing to /var/mail/root

we had a script that started writing to it.
derekh