Operating System - HP-UX
1753706 Members
4775 Online
108799 Solutions
New Discussion юеВ

Re: How to operate large mail.log ? the file is getting BIG

 
vit_foto
Occasional Collector

How to operate large mail.log ? the file is getting BIG

HI  everyone,

I have using HP-UX b11  U ia64  I got log " mail.log" in /var/adm/syslog to large for 2GB

I need to clear a log  inorder to not effect disk space  & system. 

Everyone, have method for do the following 

Thank you very much for help.

V.T

 

 

 

2 REPLIES 2
Hans_c
Occasional Advisor

Re: How to operate large mail.log ? the file is getting BIG

First, make sure you have the mail log on a backup

You can also make a copy and have it save to another temporary location and then backup from that location:

For example:

cp -p /var/adm/syslog/mail.log   /file_system_that_has_enough_space

 

To clear the log after making sure you have it on a backup or have made a temporary copy do this:

cat /dev/null > /var/adm/syslog/mail.log

That will empty out the log

 

 

Bill Hassell
Honored Contributor

Re: How to operate large mail.log ? the file is getting BIG

A large mail.log file usually indicates something is wrong.

Have you read any of the messages? Are the messages coming in every day?
If so, I would fix the problem(s) first, then copy the old mail.log file to an archive location.
Then use compress or gzip t compress the old file. It will be reduced to about 1/10 original size.



Bill Hassell, sysadmin