cancel
Showing results for 
Search instead for 
Did you mean: 

Re: /var directory at 94%

 
Super Advisor

/var directory at 94%

can i remove the /var/adm/syslog/mail.log file
trying to free up room in the /var directory ??
5 REPLIES 5
Honored Contributor

Re: /var directory at 94%

Sure. The /var/adm directory is where most of the log files live. But rather than remove the file, just truncate it to 0 bytes like this:

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

To sort the logfiles by size:

ll /var/adm | sort -nk5
ll /var/adm/syslog | sort -nk5

The largest files are at the bottom. The mail.log file in syslog can be truncated at any time. However, you need to verify that no history is required for auditors or system administrators if you truncate syslog.log. The alternative is to copy the old logfile, then truncate. logfiles can be compressed to save a lot of space:

cd /var/adm/syslog
cp syslog.log syslog.log.1
compress syslog.log.1


Bill Hassell, sysadmin
Super Advisor

Re: /var directory at 94%

Hi,

Check

/var/adm/crash


Delete files which is under crash folder , required for verification only when system crashed.

So delete all files under crash folder.

Rgd's
T(ogether) E(very one) A(chive) M(ore)
Acclaimed Contributor

Re: /var directory at 94%

>Bill: logfiles can be compressed to save a lot of space: cp syslog.log syslog.log.1

You might want to copy it to another filesystem and then use gzip rather than compress.
Frequent Advisor
Honored Contributor

Re: /var directory at 94%

> Dennis: You might want to copy it to another filesystem and then use gzip rather than compress.

Since Don did not mention the OS, I recommended compress since it has always been part of HP-UX. Moving the old syslog to another filesystem can be a future problem if the system(s) require audit trails and no one remembers where the old files are.


Bill Hassell, sysadmin