- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- routine task with /var/adm/syslog/syslog.log file
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
01-15-2006 01:23 AM
01-15-2006 01:23 AM
I cant even drop d log generated between the backup process and trimming. ie my backup copy + new syslog should make a "complete" log file.
regards
Ranjeet
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 01:40 AM
01-15-2006 01:40 AM
Re: routine task with /var/adm/syslog/syslog.log file
You can use the standard startup/stop script to accomplish this:
# /sbin/init.d/syslogd stop
# /sbin/init.d/syslogd start
Doing the two-steps above, stops the 'syslogd' daemon and upon restarting it moves 'syslog' to 'OLDsyslog' just as happens after a reboot. Upon completion, you can do whatever you want with the 'OLDsyslog' file --- copy it, rename it, etc.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 05:14 AM
01-15-2006 05:14 AM
Re: routine task with /var/adm/syslog/syslog.log file
If you don't want to stop syslogd, you can do the following:
cd /var/adm/syslog
gzip -c syslog > syslog.$(date +%a).gz
>syslog
By this way you will have compressed syslogs for last 7 days and each day you begins with a zero-size syslog
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 05:34 AM
01-15-2006 05:34 AM
Solutionyou could use logrotate tool:
Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
You can find it in:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 02:00 PM
01-15-2006 02:00 PM
Re: routine task with /var/adm/syslog/syslog.log file
#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.
HTH
tienna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 07:58 PM
01-15-2006 07:58 PM
Re: routine task with /var/adm/syslog/syslog.log file
thanks for ur suggestions.I am very sorry to say that logs generated during these activities cannot be ignored ie during restarting the syslogd daemon or > /var/adm/syslog/syslog.log .Its a highly sensitive and mission critical env.
If I move the syslog file using mv command, will the system regenerate the log file for the next log.
ie:
#mv /var/adm/syslog/syslog.log ./syslog.$(date +%a).log
regards
Ranjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2006 09:13 PM
01-15-2006 09:13 PM
Re: routine task with /var/adm/syslog/syslog.log file
You never may move a file which is used by a process. If you do that the system is holding the space.
Then you see a diverence between bdf ond du -k.
what you can do is make a copy of the logfile and after that clear the logfile with >syslog.log
But better is to use logrotate tool becauce you have more logfiles on your system that must be trimmed once in a will.
grtz. Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2006 10:03 PM
01-17-2006 10:03 PM
Re: routine task with /var/adm/syslog/syslog.log file
Thanks a lot for ur kind support.
I am still working on a stategy on managing syslog file (without third party utilities)to meet the customer requirement.
So pls mail me ur valuable suggestion at ranjeet.ar@gmail.com
Regards
Ranjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2006 10:06 PM
01-17-2006 10:06 PM