- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- rolling syslog file over
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
тАО11-16-2001 06:57 AM
тАО11-16-2001 06:57 AM
/var/adm/syslog/syslog.log
/dump/syslog/syslog.10162001
/dump/syslog/syslog.10172001
/dump/syslog/syslog.10182001
I can handle the scripting OK, I figured I'd just copy out the current syslog, then do something like:
>/var/adm/syslog/syslog.log
To clear the current log. It occurs to me though that this is not the proper way - do I need to start/stop daemons, or anything like that? Is my approach too simple?
And - would the same hold true for mail logs, su logs, wtmp and btmp?
Solved! Go to Solution.
- Tags:
- syslog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:05 AM
тАО11-16-2001 07:05 AM
Re: rolling syslog file over
Please see the attached shell script for examples of how this can be accomplished. I downloaded this script from HP awhile back and I don't remember the site off the top of my head, but the attached script hasn't been edited. I think it will meet your needs.
-Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:08 AM
тАО11-16-2001 07:08 AM
Re: rolling syslog file over
To clear the current log. It occurs to me though that this is not the proper way >>
It is the correct way. The inode number remains the same , so the syslogd file should not have any problem in writing to the file.
<
No need to restart the daemons. The simple way works ;-)
<
Yes, the same holds true. But, i would not suggest you to Zero out the wtmp and btmp files. If you do that, the last and lastb commands will not show the old login information.
Just curious, why do you want to copy the syslog file daily?? Is it because of lack of space in /var filesystem?? If you are doing system backup daily, the syslog file would be copied as a part of the backup.
HTH
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:14 AM
тАО11-16-2001 07:14 AM
Re: rolling syslog file over
That will work, just realize there is a slight possibility that something could get written to the syslog between the copy and "zapping".
Redirecting "nothing" as you show is fine. Removing and recreating syslog without stopping daemons is not.
You can also use SAM to trim the log but then you won't have the historical copies.
You may also want to set an rc file to make a copy of OLDsyslog.log at every boot. I've had a number of times this file was lost because of back to back boots. Bummer.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:15 AM
тАО11-16-2001 07:15 AM
Re: rolling syslog file over
Cheers,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2001 07:31 AM
тАО11-16-2001 07:31 AM
Re: rolling syslog file over
Darrell, I had considered the idea that the file may be written to; I'm liking the SIGHUP idea as a way to prevent that.
Agreed, I don't think I'll move wtmp or btmp until they hit some size limit or have been reviewed for security. That data is good to have online.
To answer why am I doing this - yes primarily disk space.
Perhaps monthly copying the file out would be sufficient, I hadn't figured out that part yet.