- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to rotate log every day and how to keep 9 ...
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
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
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-28-2011 10:26 PM
06-28-2011 10:26 PM
How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
Hi,
I want to know how to rotate logs everyday. Is this possible by editing /etc/rc.config.d/syslogd??? If then how i do that? And i have another query. How i will keep at least 9 increments of logs in my local system? It's very urgent. Please help me to solve above issues ASAP.
Regards,
Arafat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2011 11:36 PM
06-28-2011 11:36 PM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
in normally , when system is rebooted, the startup sequence for syslog (/sbin/init.d/syslogd) will rename the oldsyslog.log file to OLDsyslog.log. if you want totake control of it you can use cron to automate and can use a script inside.
first copy the current syslog.log to syslog.log$$ then empty the log file;
# cp syslog.log syslog.log$$
# > syslog.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2011 12:50 AM
06-29-2011 12:50 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
Hello,
You can use logrotate ported to HP-UX:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-3.7.9/
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2011 01:03 AM
06-29-2011 01:03 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
how i use this? plz give me a sample script. and what is the meaning of $$?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2011 02:46 AM
06-29-2011 02:46 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
>what is the meaning of $$?
$$ is the shell variable for the current PID. It is used as a fairly unique value before recycled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2011 04:09 AM
06-29-2011 04:09 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
simple script can be:
#!/usr/bin/sh
/usr/bin/cd /var/adm/syslog
/usr/bin/cp syslog.log syslog.log$$
#OR use dated version : /usr/bin/cp syslog.log syslog.$(/usr/bin/date +%d%m%y)
#empty current log
> syslog.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2011 03:21 AM
06-30-2011 03:21 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
thnx hakki for ur help........it is very much helpful for me.....but what about 9 increment of logs????? how i keep at least 9 increments of logs in local system???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2011 04:12 AM
06-30-2011 04:12 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
Hi,
you might want to try a script from Bill Hassel, you can find it here:
http://h30499.www3.hp.com/t5/System-Administration/Trim-Log-Files/m-p/3847979#M274410
hth
Stephan
How to find the right forum --> New forum location by ITRC tree
"we wouldn't call it code, if we could read it ..."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2011 04:29 AM
06-30-2011 04:29 AM
Re: How to rotate log every day and how to keep 9 increments of logs in hp-ux 11.31
>Is this possible by editing /etc/rc.config.d/syslogd?
No that would be too simple. :-(
About the only option is: PREV_OLDSYSLOG_LINES
>How I will keep at least 9 increments of logs in my local system?
You'll need to do some scripting. Look at the above suggestions, especially logrotate.