Operating System - HP-UX
1850645 Members
2959 Online
104054 Solutions
New Discussion

Re: Deleting operating system logs

 
Manuales
Super Advisor

Deleting operating system logs

Hi !!
Could you tell me, what kind of logs can i delete from all my unix system?

For example: var/adm/syslog.log
/var/spool/

what kind of log's can i delete every week for example?

can i delete /var/spool/mqueue ??
can i delete /var/spool/pwgr ??
what another logs can i delete?

Thanks, Manuales
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Deleting operating system logs

I would suggest that you not delete any logs. Instead, you can trim them using SAM > Routine Tasks or a shell script through cron.


Pete

Pete
Rick Garland
Honored Contributor

Re: Deleting operating system logs

Most of these logs you do not want to delete. Open processes have the log files open so the inodes are still in use. This results in a 0 byte file but the filesystem usage does not change.

Use 'cat /dev/null > $filename' to empty the contents of respective file.

Bharat Katkar
Honored Contributor

Re: Deleting operating system logs

Hi,
You can delete/trim following files/logs but make sure that this data is either not required or backed up.
Log files are necessary to troubleshoot problems and to study the behaviour of the application.

1. /var/adm/syslog/syslog.log
2. /var/opt//
3. /var/tmp/
4. wtmp file
5. btmp file
6. Core files that get generated

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Christine Hartman
Valued Contributor

Re: Deleting operating system logs

Hi Manuales,

attached is a script that I use to keep logfiles managed. Hope this helps!
CHristine
Raj D.
Honored Contributor

Re: Deleting operating system logs

Hi Manuales ,

If you dont need to keep the log , You can nullify this log files , which grows much more :


/var/adm/syslog/syslog.log
/var/adm/wtmp
/var/adm/syslog/mail.log
/var/adm/cron/log

And it can recover filesystem space,

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Manuales
Super Advisor

Re: Deleting operating system logs

Thanks all people ..
i uderstand very well Christine Hartman, thank you very much ...