Operating System - HP-UX
1823986 Members
3964 Online
109667 Solutions
New Discussion юеВ

Re: Prune Log Files, Delete Temporary Files ...

 
SOLVED
Go to solution
Thomas Rupp
New Member

Prune Log Files, Delete Temporary Files ...

Hi HP-UX gurus,
I have to administer one AIX and one HP-UX 11 box so I'm not very firm with both OS-es.

Yesterday I found a skript for AIX (tidysys) to prune log files (wtmp, failedlogin, sulog, smit-logs ..), delete temporary files older x days, delete core-dumps etc. etc.

What do you use to clean-up your system and prevent log-files from filling up your filesystems?

Thanks in advance
Thomas Rupp
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: Prune Log Files, Delete Temporary Files ...

Thomas,

I use a home-grown script nightly via cron. The script is actually a series of find commands, like "find /tmp -type f -mtime +2 -exec rm {} \;". That way I can just add whatever the latest location to search into the script and cron will run it. There are also some other scripts to shrink wtmp, reorg VxFS file systems, etc.


Pete

Pete
Cheryl Griffin
Honored Contributor
Solution

Re: Prune Log Files, Delete Temporary Files ...

You can set up cron jobs to help find and remove core files.

Logrotate http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

And SAM --> Routine Tasks --> System Log files - under Actions, Trim

Look into /etc/rc.config.d/clean_tmps also.
"Downtime is a Crime."
Muthukumar_5
Honored Contributor

Re: Prune Log Files, Delete Temporary Files ...

We can trim / rotate log files and core dumps using the find command with size and mtime.

Log files are stored over /var/adm/ location.

And more without simply delete them you can take backup by zipping them with gunzip or bunzip2.

collect files using find and take tar those files.

Some of the files will get location over /tmp/ location.

You can logrote or your own script with cron for this.


Easy to suggest when don't know about the problem!
Thomas Rupp
New Member

Re: Prune Log Files, Delete Temporary Files ...

Thanks a lot - I will have a look at logrotate!

Thomas Rupp