maillog

Hi Sir:
we have postfix mail server running in Centos 5. yesterday I started to get message in log that there is insufficient space., then I contacted one guy he told me that VAR is full you need to flush or delete to make space free. I don't have an idea how to flush and make space free; requesting me to guide or educate me how to make space free without any effect on mail server function.
Sanjeev jhaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
mailq
(anything here?)

cd /var
du -sk * | sort -n
(Whos top consumer of disk space?)

Once we know it we will figure out best way to proceed.
0
Sanjeev jhaAuthor Commented:
I got the output by this command
du -sk * | sort -n
Now what should and How do i do for making free.
4       mail
8       ftp
8       games
8       local
8       nis
8       opt
8       preserve
8       racoon
8       rrdtool
8       tmp
12      account
16      lost+found
20      gdm
24      yp
28      db
32      empty
32      lock
88      named
256     run
560     webmin
66044   cache
111516  clamav
199960  virusmails
508316  spool
777952  lib
882932  amavis
1423488 www
10218052        log
0
gheistCommented:
now repeat same command in log/ - maybe we need to configure log rotation to make it work better
i suspect virusmails is sort of quarantine and you can delete most of it.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

SandyCommented:
run below one

#find /var -xdev -ls | sort -nr -k 7 | head -20

and then also check the  data in /var/spool

TY/SA
0
Sanjeev jhaAuthor Commented:
find /var/ -xdev -ls | sort -nr -k 7 | head -20
 65286 1085792 -rw-------   1 root     utmp     1110761472 Oct  6 18:44 /var/log/btmp
4994028 645484 -rw-rw----   1 mysql    mysql    660322116 Oct  6 19:45 /var/lib/mysql/amavis/msg.MYD
 65375 497740 -rw-r--r--   1 root     root     509181211 Oct  6 19:48 /var/log/httpd/access_log
 65319 149532 -rw-------   1 root     root     152963711 Oct  6 19:38 /var/log/xferlog
 65380 149448 -rw-------   1 root     root     152875814 Oct  6 19:48 /var/log/vsftpd.log
3623058 63272 -rw-r--r--   1 clamav   clamav   64720632 Dec 26  2013 /var/clamav/main.cvd
 65440 55932 -rw-------   1 root     root     57209282 Oct  6 19:48 /var/log/cron
 65353 45204 -rw-------   1 root     root     46235648 Jun 27  2011 /var/log/.maillog.1.swp
4961774 37380 -rw-r-----   1 root     slocate  38230739 Jun 16 04:22 /var/lib/mlocate/mlocate.db
4961286 29320 -rw-r--r--   1 rpm      rpm      29986816 Oct  6 13:30 /var/lib/rpm/Packages
 65448 26784 -rwxrwxrwx   1 dovecot  dovecot  27392526 Oct  6 19:49 /var/log/dovecot.log
457040 25788 -rw-r--r--   1 root     root     26372096 Oct  1 21:49 /var/cache/yum/rpmforge/primary.xml.gz.sqlite
4961780 25644 -rw-r--r--   1 clam     clam     26224310 Jul 27  2011 /var/lib/clamav/main.cvd
 65428 25072 -rw-------   1 root     root     25637842 May 12  2013 /var/log/maillog.4
 65381 24988 -rw-------   1 root     root     25553411 Oct  6 19:48 /var/log/maillog
 65418 23532 -rw-------   1 root     root     24067872 Jun  2  2013 /var/log/maillog.1
 65415 23516 -rw-------   1 root     root     24050735 May 19  2013 /var/log/maillog.3
 65416 22552 -rw-------   1 root     root     23061228 May 26  2013 /var/log/maillog.2
3623045 22400 -rw-r--r--   1 clamav   clamav   22906487 Apr  1  2010 /var/clamav/main.cvd.rpmnew
 65358 22056 -rw-r--r--   1 amavis   amavis   22554328 Jun  2  2013 /var/log/amavis.log.1
[root@firewall ~]#
0
Sanjeev jhaAuthor Commented:
[root@firewall spool]# du -sk * | sort -n
8       lpd
8       repackage
8       vbox
12      cron
16      cups
20      at
20      vacation
24      mail
32      anacron
7056    squirrelmail
47408   postfix
205444  squid
0
Sanjeev jhaAuthor Commented:
command suggested by you and output shared.
Please now tell me next command by which I can be able to manage var log files so that my mailserver not stuck and do not bounce any mail.
0
gheistCommented:
You can zero btmp file (list of all failed logins)
:>/var/log/btmp
amavis database in mysql is not cleaned up

You need to rotate logs sometimes (and dont try to edit them with vi to not create likely-sized backup copies)
0
Sanjeev jhaAuthor Commented:
if i understood you correctly then should i delete btmp file from log?
0
gheistCommented:
TRUNCATE, not delete, as indicated, and probably restrict unsolicited login channels where mass password guessing takes place.
0
Sanjeev jhaAuthor Commented:
How this command works and it would be applicable for all which is under /var.

I would appreciate the way you are helping.
Hope you will help me until i understood perfectly.
0
gheistCommented:
: > /var/log/btmp
NOOP outputing_to A_FILE
0
Sanjeev jhaAuthor Commented:
/var/spool/clientmqueue

there is a file in clientmqueue...
which command needs to run to remove files under this. please mentioned.
0
SandyCommented:
this has all deffered mails you can delete by using rm -rf /var/spool/clientmqueue/*

TY/SA
0
Sanjeev jhaAuthor Commented:
Thanks I run this command and deleted the file and size become lowest in KB

one thing just would like to confirm with you if i need to empty the log file without any impact on original log file which command should i run to make log empty?
thanks for your cooperation
and would appreciate if you tell me on which log this command can be run and How
0
Sanjeev jhaAuthor Commented:
is this command is correct echo /dev/null > maillog
0
SandyCommented:
First take the backup in case u need in future then do the gzip

use the above command to truncate the log file will work

ty/sa
0
gheistCommented:
: means abbreviation of "true"

: >/var/log/maillog
0
Sanjeev jhaAuthor Commented:
Thanks Sir: There is one folder as the name of 'Virtual' in home directory. It is showing 90% full how it can be reduce in size without any side effect on running mail server.
Please help me regarding this. I would appreciate for always support.
0
gheistCommented:
Can you illustrate it with
# du -sk| sort -n
?
0
Sanjeev jhaAuthor Commented:
[root@firewall home]# du -sk| sort -n
38639192
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sanjeev jhaAuthor Commented:
Issue has been solved.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.