- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to do log rotation in HP-UX?
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-23-2010 09:08 AM
тАО06-23-2010 09:08 AM
I knew that log will be rotated for every reboot, therefore one file with extention of .old will be created.
But I would like to log rotation for every month. So I need one log file for one month.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2010 09:17 AM
тАО06-23-2010 09:17 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2010 09:21 AM
тАО06-23-2010 09:21 AM
Re: How to do log rotation in HP-UX?
There is an old 'logrotate' utility at the HP-UX Porting Centre which you would have to compile yourself.
That said, you don't offer which HP-UX operating system versions you're using nor *which* logs you want kept monthly.
All this said, you could cruft a simple script (and schedule that from 'cron') that would call the standard startup/shutdown scripts like '/sbin/init.d/syslogd' to close and open a new logfile. Your script would then conclude its action by renaming the "OLD*" logfile to one with the month name.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2010 09:22 AM
тАО06-23-2010 09:22 AM
Re: How to do log rotation in HP-UX?
creata a cron job to run every month to
restart the syslogd deamon by
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2010 10:46 PM
тАО06-23-2010 10:46 PM
Re: How to do log rotation in HP-UX?
Check this out: Logrotate Management 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.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
This is quite old tool, but you can try it out,
You can also find simple shell script or perl script that help to rotate the log:
Ex: (Change the logfile path for hp-ux to /var/adm/syslog/syslog.log )
------
## Configuration for logrotate
# Please read perl-logrotate.pl for more information
logfile /var/log/messages
rotate-time 1 week
keep-files 5
compress yes
status-file /var/cache/logrotate.status
dryrun yes
-------
Link:
http://freshmeat.net/projects/perl-logrotate/
Hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2010 11:33 PM
тАО06-23-2010 11:33 PM
Re: How to do log rotation in HP-UX?
You can schedule the log rotation to run based on your own schedule using cron.
Check the following link for more details -
* Syslog log rotation
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1230095
* Scheduling logrotate
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=382206
* logroate equivalent
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=799136
* Perl-Logrotate script
http://freshmeat.net/projects/perl-logrotate/
Hope this helps.
Regards,
Murali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2010 12:38 AM
тАО06-24-2010 12:38 AM
Re: How to do log rotation in HP-UX?
Check the thread:
http://forums11.itrc.hp.com/service/forums/parseCurl.do?admit=109447626+1277368630580+28353475&CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x77928cc5e03fd6118fff0090279cd0f9%2C00.html
Rgds-Kranti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2010 01:15 AM
тАО06-24-2010 01:15 AM
Re: How to do log rotation in HP-UX?
put cron job for every month begining
Take a backup of OLDsyslog.log file before restart syslog daemon
Cronjob entries below.
30 0 1 * * /usr/bin/mv /var/adm/syslog/OLDsyslog/log /var/adm/syslog/OLDsyslog/log1
32 0 1 * * /sbin/init.d/syslogd stop
33 0 1 * * /sbin/init.d/syslogd start