- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 07:07 AM
06-27-2000 07:07 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 07:06 AM
06-27-2000 07:06 AM
Re: System Administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 07:22 AM
06-27-2000 07:22 AM
Re: System Administration
SAM is one good tool to keep on top of this. Also in the porting archive
is a trimlog binary. You can do the configs for what is to be done and all that good stuff. You could also write a script to do the tasks. Be careful though. some of the log files will need to be handled with care. Example is the syslog.log file. You may want to cp it somewhere then cat /dev/null > syslog.log because it is an open file. You may want to kill -HUP `cat /var/run/syslog.pid` to have it restart as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 07:29 AM
06-27-2000 07:29 AM
Re: System Administration
0 08 27 12 * cat /dev/null > /var/adm/wtmp
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 11:27 AM
06-27-2000 11:27 AM
Solutionwrite a script like this and add it to your cron
find / -depth -print|grep -i .log$ > /tmp/loglist
for X in `cat /tmp/loglist`
do
tail -50 $X > /tmp/templog
rm $X
mv /tmp/templog $X
done
This is the most simple way
you should add an if statement making sure /tmp/templog exists before removing and copying over the log file
you can also add -size +2000 to the find
this will limit the truncating of log files to just large ones
add a line with in the for statement
echo $X >> somefile
to keep a log of what files were clipped
you can also not delete but rename you log files each day
mv $X $X`date "+%m%d%y"`.log
then after the for statement run another find command
find / -depth -print -atime +x -exec rm {} /;
x being the number of days old the file deleted should be
i am sure there are more in depth ways to do this for people who script much better than i
and remember use sam for system files its better and much eaiser
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2000 11:32 AM
06-27-2000 11:32 AM
Re: System Administration
i should of said /dir of the dir your application is in
if you do just / you will get the.log of the system files that sam would take care of for you
sorry
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2000 09:28 AM
07-14-2000 09:28 AM
Re: System Administration
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2000 10:56 AM
07-14-2000 10:56 AM
Re: System Administration
tail -50 $LOGFILE > $TMPFILE
cat $TMPFILE > $LOGFILE
Note: tailing from the logical EOF is dangerous if you really want to preserve a large chunk of information, since the buffer will only hold 20K. That shouldn't be a worry for this problem, though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2000 04:41 PM
07-14-2000 04:41 PM
Re: System Administration
ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/cronjobs
The dailylogs script will trim the fast growing files, where weeklylogs will trim a given logfile if it exceeds a set value. Each script is designed to be expanded and modified for local situations.
Bill Hassell, sysadmin