- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- can i delete the logs
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
Discussions
Discussions
Discussions
Forums
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
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
тАО01-16-2006 02:58 AM
тАО01-16-2006 02:58 AM
can i delete the some log entries from /var/adm/syslog/syslog.log file.
if yes, then how can i?
thanks
bunty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 03:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 03:03 AM
тАО01-16-2006 03:03 AM
Re: can i delete the logs
But in your case, I would leave the syslog.log alone until your disc is working - you might need to refer to it. Talking of which, you haven't told us how you're getting on with that disc in a while.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 03:05 AM
тАО01-16-2006 03:05 AM
Re: can i delete the logs
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 04:29 AM
тАО01-16-2006 04:29 AM
Re: can i delete the logs
You should not delete the file , but you can nulligy the log files to recover space.
# > /var/adm/syslog/syslog.log
# > /var/adm/syslog/mail.log
Enjoy ,
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 06:52 AM
тАО01-16-2006 06:52 AM
Re: can i delete the logs
# cat get-rid-of-ftp-syslog
#!/bin/sh
# script to zero out the syslog and make a bacup of it without ftp logs
# gwild
DIR=/var/adm/syslog
cp -p $DIR/syslog.log $DIR/syslog.log.bak
> $DIR/syslog.log
sed -n '/ftp/!p' $DIR/syslog.log.bak > $DIR/syslog.log.noftp.`date +%b%d%H%M`
Also, logrotate may help you as well:
http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 08:46 AM
тАО01-16-2006 08:46 AM
Re: can i delete the logs
I configured like so:
# cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 5
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/adm/wtmp {
monthly
create 0664 adm adm
rotate 1
}
# system-specific logs may be also be configured here.
# ll /etc/logrotate.d
total 48
-rw-r--r-- 1 root sys 65 May 19 2004 maillog
-rw-r--r-- 1 root sys 65 Mar 14 2005 named.log
-rw-r--r-- 1 root sys 161 Aug 19 2004 syslog
# cat /etc/logrotate.d/maillog
/var/adm/syslog/mail.log {
rotate 5
weekly
}
# cat /etc/logrotate.d/named.log
/var/adm/named/named.log {
rotate 5
weekly
}
# cat /etc/logrotate.d/syslog
/var/adm/syslog/syslog.log {
rotate 5
weekly
postrotate
/usr/bin/kill -HUP `ps -ef |grep syslogd |awk '{print $2}'` || true
endscript
}
And in cron:
# logrotate
0 0 * * * /opt/logrotate/bin/logrotate /etc/logrotate.conf >/tmp/logrotate.cron 2>&1
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 12:42 PM
тАО01-16-2006 12:42 PM
Re: can i delete the logs
1. touch /var/adm/syslog/syslog.log
2. chmod 644 /var/adm/syslog/syslog.log
3. /usr/sbin/syslogd -D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 05:46 PM
тАО01-16-2006 05:46 PM
Re: can i delete the logs
==
You can backup it by tar command
#tar cvf /path/newfile /var/adm/syslog/syslog.log
Trim file:
#>/var/adm/syslog/syslog.log
But I highly recommend you use logrotate
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
to rotate your log.
========================
your question is the same as:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=991878
pls find other and my answer !
HTH
tienna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 07:08 PM
тАО01-16-2006 07:08 PM
Re: can i delete the logs
Here a good ksh script found on this forum some time ago. It rotate log files based on size, lifespan, It allow compression, manage the "old" files log generated by the system (eg OLDsyslog.log vs syslog.log), the number of copies to maintain, the security parameters to be applied to the files with chmod and chown. You can easily add or remove the log files which you wish to manage. This script already contains the majority of the basic hpux 11.11 log files. It is simple, easy to adapt and deserves to be examined.
Regards, Joel