- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- purging syslog.log
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
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
тАО06-08-2006 02:32 AM
тАО06-08-2006 02:32 AM
Thanks.
Solved! Go to Solution.
- Tags:
- trim logfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2006 02:43 AM
тАО06-08-2006 02:43 AM
Re: purging syslog.log
if you want to rotate the syslog files, you can restart the syslogd daemon:
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start
OLDsyslog.log will be remove, syslog.log will move to OLDsyslog.log.
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2006 02:47 AM
тАО06-08-2006 02:47 AM
Re: purging syslog.log
Copy it first to save location
# cp /var/adm/syslog/syslog.log /tmp/syslog.old
# cp /dev/null /var/adm/syslog/syslog.log
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2006 02:49 AM
тАО06-08-2006 02:49 AM
Re: purging syslog.log
One tool available on the http://gate.cs.utah.edu site is "logrotate"
You can input the names of the logfiles, how oftern to rotate, how many copies to keep, if you want to roatate on file size, etc.
SAM is avail to purge log files as well but this reuires manual intervention.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2006 03:08 AM
тАО06-08-2006 03:08 AM
SolutionTo prevent this from happening in the future, you could cron something like the following to run just before midnight:
#!/usr/bin/sh
set -u
DATE=`date +%Y%m%d`
###############################
# syslog
###############################
cd /var/adm/syslog
rm syslog.yester.log
cp syslog.log syslog.$DATE.log
ln -s syslog.$DATE.log syslog.yester.log
cat /dev/null > syslog.log
find /var/adm/syslog -name 'syslog.*.log' -mtime +90 -exec rm -f {} \;
This way, you have one syslog file per day, and syslog.yester.log is a symlink to yesterday's log, which is useful in scripts and command aliases (I have an alias which does a more on syslog.yester.log and syslog.log). If you find you have too many files or too much space is being taken up, you may scale back on the 90-day retention, or compress logsfiles.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2006 03:20 AM
тАО06-08-2006 03:20 AM
Re: purging syslog.log
Mark Syder (like the drink but spelt different)