Reducing log files

Reducing log files

Post by Paul Johnsto » Wed, 19 Apr 2006 21:15:36



Hi
I've been asked to clear some space on a mail server as the logs are
filling up the partition.
I've not had a Unix role in many years now :-(  but seem to remember
that instead of deleteing files i.e.

rm mmcheck.log

I was told to do

Quote:> mmcheck.log

This way the file is not deleted but its contents are emptied. I sort
of forgot, or more never likely knew what exactly this does to a file.
Could some kind person give me a clue as what is happening.
Doing this with my ordinary account on a file gives me:

Invalid null command

TIA Paul

 
 
 

Reducing log files

Post by Casper H.S. Di » Wed, 19 Apr 2006 21:27:50



>Doing this with my ordinary account on a file gives me:
>Invalid null command

Wrong shell :-)

This, I think, works for all shells:

        : > filename

":" is generally the "empty command"; the shell evaluates its arguments
and the redirections; but it does not execute any command.
(It works in sh, csh, tcsh, zsh, ksh, bash)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

Reducing log files

Post by Lion- » Fri, 21 Apr 2006 23:59:02


Quote:> Could some kind person give me a clue as what is happening.

Apart from Casper's comments you might also want to look into the "logadm"
command, this can help you cycle your logfiles and removing them after a
certain amount of time.

--
Groetjes, Peter

.\\ PGP/GPG key: http://www.catslair.org/pubkey.asc

 
 
 

1. Reduce Log File Size - How?

I am running SuSE 6.1 and the var/log/messages file is getting very
large.  Is there a utility to limit its size by either date or size?
Can I just occasionaly delete it?
-----------------------------
Orrin - Long Island, New York
Orrin's Caribbean Index - http://www.orrin.org/carib/
Syosset Camera Club - http://www.orrin.org/syocc/
HS Class Reunion - http://www.orrin.org/wphs/
Our e-mail address is at  http://www.orrin.org/email.html

2. ld.so (binary corruption)

3. Ways of reducing log files sizes automatically

4. gcc / xforecast problem...

5. Reducing the size of a log file (without interrupting a running application) (Bourne shell)

6. ESS 688 16-bit audio chip in notebook, howto use?

7. How can I split a log file into several log files?

8. Err on applying patch2.4.19rc1

9. wierd stuffs in proxy log file and back end server log file

10. Reduce file system file

11. Yacc: reduce/reduce-conflict

12. Reduce gif without reducing resolution?

13. reduce tomcat logging/ apache_log / catalina