- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- to clear syslogs
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
тАО12-10-2008 10:55 AM
тАО12-10-2008 10:55 AM
which is stored in /var/adm/syslog/syslog/log.
and please tell me the command to clear the logs
Solved! Go to Solution.
- Tags:
- syslog
- trim logfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:01 AM
тАО12-10-2008 11:01 AM
Re: to clear syslogs
mv /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.log
> /var/adm/syslog/syslog.log
That will save syslog and then null it out for you.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:03 AM
тАО12-10-2008 11:03 AM
Re: to clear syslogs
can i do it without rebooting the server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:06 AM
тАО12-10-2008 11:06 AM
Re: to clear syslogs
Take backup of syslog.log if required
Trim it..
>/var/adm/syslog/syslog.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:11 AM
тАО12-10-2008 11:11 AM
Re: to clear syslogs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:13 AM
тАО12-10-2008 11:13 AM
Solutionyou *don't* want to move ('mv') the log file; rather you want to *copy* it and then truncate the original. This keeps logging working into the originally named file and not the renamed backup!
# cp /var/adm/syslog/syslog.log /var/adm/syslog/syslog.log.old
# cat /dev/null > /var/adm/syslog/syslog.log
Another way to do this is to do:
# /sbin/init.d/syslogd stop
# /sbin/init.d/syslogd start
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:13 AM
тАО12-10-2008 11:13 AM
Re: to clear syslogs
having trimmed a/the syslog-file(s), I recommend to inform a running syslogd about it via
kill -HUP `cat /var/run/syslog.pid`
You should get an entry in the new base syslog-file from syslog about a restart as well.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 11:22 AM
тАО12-10-2008 11:22 AM
Re: to clear syslogs
After you run this, you can always rename OLDsyslog.log to something else if you desire.
# /sbin/init.d/syslogd stop
# /sbin/init.d/syslogd start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 02:26 PM
тАО12-10-2008 02:26 PM
Re: to clear syslogs
Now my server is in production (LIVE).
if i stop and start the below script, is there any critical for running server.
kindly confirm and i will be very thankful to you all
# /sbin/init.d/syslogd stop
# /sbin/init.d/syslogd start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 02:28 PM
тАО12-10-2008 02:28 PM
Re: to clear syslogs
> Now my server is in production (LIVE). if i stop and start the below script, is there any critical for running server?
No, this is absolutely safe. At most you might lose a few seconds of logged information while the 'syslogd' isn't active.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 02:32 PM
тАО12-10-2008 02:32 PM
Re: to clear syslogs
Interesting timing for this question :)
I am presenting a world-wide webinar at HP this week. The topics is:
Comparison of log file management tools in
AIX, HP-UX, Solaris, and Linux
I plan to release a public version of it
in next several months. It will be on
my home web page.
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2008 03:29 PM
тАО12-10-2008 03:29 PM