1832964 Members
2582 Online
110048 Solutions
New Discussion

Mail folder under VAR

 

Mail folder under VAR

Our hp server we are not running any kind of mail. this server is our main NNM server with 30 users and we have a large network with 2000 cisco routers and switches. The VAR is getting near about 80% used, I was trying to clean it up to make som more space, while I am going through the VAR I noticed that there is a direct called " Mail" and under this directory there is file in the name of all our users and one file for root and another for bin, most of the users file is 0, but the bin and root files are reaily big I wonder since we are not running any mail application on this server why this folder and files, I reaily need to keep this file, can I deleate this file. or make it " 0 ".
no personal quote
7 REPLIES 7
G. Vrijhoeven
Honored Contributor

Re: Mail folder under VAR

Hi,

I would advice to scan roots mail before cleaning up. you can use mail from tho command line to read/delete your mail or vi the file and read trough it before deleting.

Gideon
harry d brown jr
Honored Contributor

Re: Mail folder under VAR

Raghuram,

If you are running cron's, then you are using mail. What was the full directory path?


live free or die
harry
Live Free or Die
Paula J Frazer-Campbell
Honored Contributor

Re: Mail folder under VAR

Hi
Cron by default mails it output to root this large root mail file will be the result of cron mails.

SO whilst your users are not using mail the system is and this mail to root should be monitored, ems and predictive can also use roots mail to warn/inform you of current/pending problems.


Enter mail as root user at the prompt.

q quit
x exit without changing mail
p print
s [file] save (default mbox)
w [file] same without header
- print previous
d delete
+ next (no delete)
m user mail to user
! cmd execute cmd

HTH

Paula

If you can spell SysAdmin then you is one - anon
James R. Ferguson
Acclaimed Contributor

Re: Mail folder under VAR

Hi:

As a general comment about space in /var, you might want to assess which directories occupy significant space:

# u -k /var|sort -nrk1|more

You might also want to trim log files like the /var/adm/wtmp and /var/adm/btmp if you are using them:

# cat /dev/null > /var/adm/wtmp

Old processor logs in /var/tombstones can be removed. Log #99 in the most *current*.

/var/preserve contains 'vi' recovery files which may no longer be needed.

A very large amount of space is often recoverable in /var/adm/sw by using *ONLY* the 'cleanup' utility (see its man pages). Removing files or directories in /var/adm/sw by any means other than 'cleanup' can lead to an un-patchable system! Use, for instance:

# cleanup -c 1

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: Mail folder under VAR

Hi,

The mail files for root and bin and most probably system generated. Most of the time, the system will send a mail to root if there is a problem, say a root cron job didn't run or things like that. You can safely delete these files under /var/mail. The system will recreate the files next time. However it would be a good idea to read the contents of the file as you may come to know what are the mail being sent to root and if there is a problem somewhere that has been overlooked.

Hope this helps.

Regds
Darrell Allen
Honored Contributor

Re: Mail folder under VAR

Hi,

I also advise you to read root's mail before simply deleting it.

If root's getting mail from cron jobs, simply redirect stdout and stderr to a file or /dev/null from the cron job.

Normal users may also get mail when print jobs are canceled. Most of my users can't access command line so I simply blow away their mail.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Bill Hassell
Honored Contributor

Re: Mail folder under VAR

Reading root's email is a good idea. If you have many servers, then redirect root's mail to a central address so information from any of the root accounts will always be read without having to make the rounds. To do this, edit the file:

/etc/mail/aliases

and setup these lines in that file:

uucp: root
daemon: root
lp: root
mailman: root
webmaster: root
hostmaster: root
postmaster: root
MAILER-DAEMON: root
adm: root
op: root
rlp: root
bin: root

root: monitor@another.machine.com

Repeat on all servers, then run the command:

# newaliases

While you are at it, you can eliminate all user email automatically with:

#!/usr/bin/sh
# /dev/null all user email
umask 027
for USER in /home/*
do
echo ":include:/dev/null" > $USER/.forward
chown ${$USER##*/}:mail $USER/.forward
done

What this does is to put a .forward file in every directory in/home. Modify it accordingly if you use something other than /home for user directories.


Bill Hassell, sysadmin