GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Log Rotate does not rotate log files
Operating System - HP-UX
1844060
Members
3326
Online
110227
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
04-02-2004 07:10 AM
04-02-2004 07:10 AM
Log Rotate does not rotate log files
I have downloaded and installed logrotate from following link.
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/logrotate-2.5/
Following is my conf file content.
-----------------------------------------------
/opt/logrotate/conf# more logrotate.conf
# Sample log rotate configuration file.
errors root
compress
create
# syslog.log file rotation
/var/adm/syslog/syslog.log {
rotate 5
daily
postrotate
/sbin/killall -HUP syslogd
endscript
}
# mail.log rotation
/var/adm/syslog/mail.log {
rotate 5
daily
postrotate
/sbin/killall -HUP syslogd
endscript
}
----------------------------------------------
I have a cron job which runs logrotate every night. but everyday I get following email. and nologs are rotated.
reading config file /opt/logrotate/conf/logrotate.conf
reading config info for /var/adm/syslog/syslog.log
reading config info for /var/adm/syslog/mail.log
Handling 2 logs
rotating pattern: /var/adm/syslog/syslog.log after 1 days (5 rotations)
empty log files are rotated old logs are removed
errors will be mailed to root
rotating file /var/adm/syslog/syslog.log
log does not need rotating
rotating pattern: /var/adm/syslog/mail.log after 1 days (5 rotations)
empty log files are rotated old logs are removed
errors will be mailed to root
rotating file /var/adm/syslog/mail.log
log does not need rotating
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/opt/logrotate/bin/logrotate -d /opt/logrotate/conf/logrotate.conf
What am I missing?
Thanks
Ashish
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/logrotate-2.5/
Following is my conf file content.
-----------------------------------------------
/opt/logrotate/conf# more logrotate.conf
# Sample log rotate configuration file.
errors root
compress
create
# syslog.log file rotation
/var/adm/syslog/syslog.log {
rotate 5
daily
postrotate
/sbin/killall -HUP syslogd
endscript
}
# mail.log rotation
/var/adm/syslog/mail.log {
rotate 5
daily
postrotate
/sbin/killall -HUP syslogd
endscript
}
----------------------------------------------
I have a cron job which runs logrotate every night. but everyday I get following email. and nologs are rotated.
reading config file /opt/logrotate/conf/logrotate.conf
reading config info for /var/adm/syslog/syslog.log
reading config info for /var/adm/syslog/mail.log
Handling 2 logs
rotating pattern: /var/adm/syslog/syslog.log after 1 days (5 rotations)
empty log files are rotated old logs are removed
errors will be mailed to root
rotating file /var/adm/syslog/syslog.log
log does not need rotating
rotating pattern: /var/adm/syslog/mail.log after 1 days (5 rotations)
empty log files are rotated old logs are removed
errors will be mailed to root
rotating file /var/adm/syslog/mail.log
log does not need rotating
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/opt/logrotate/bin/logrotate -d /opt/logrotate/conf/logrotate.conf
What am I missing?
Thanks
Ashish
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2004 07:28 AM
04-02-2004 07:28 AM
Re: Log Rotate does not rotate log files
I have a few observations first...
I guess my first question is why are you rotating your syslog and mail log every day? and why are you rotating out logs every 5 days?
Seems a bit over managed...
Seems I have pretty active boxes and once a month reboots generates a OLDsyslog.log and a new syslog.log giving me 2 months worth of syslog and mail log...
_____________________________________________________
You can do this easier... with this in the script. No need to do -HUP at all.
I think that is where you are hanging.
cp syslog.log to oldsyslog.log
> syslog.log
I guess my first question is why are you rotating your syslog and mail log every day? and why are you rotating out logs every 5 days?
Seems a bit over managed...
Seems I have pretty active boxes and once a month reboots generates a OLDsyslog.log and a new syslog.log giving me 2 months worth of syslog and mail log...
_____________________________________________________
You can do this easier... with this in the script. No need to do -HUP at all.
I think that is where you are hanging.
cp syslog.log to oldsyslog.log
> syslog.log
Unix, the other white meat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2004 07:57 AM
04-02-2004 07:57 AM
Re: Log Rotate does not rotate log files
Thanks for your input.
This is test that I have set up on our test server. To actually see logs being rotated, I have set it up for daily rotation.
Once I have it working properly I will change the frequency and save time.
Did not understand your comment about script. Are you saying I do not need postscript at all?
My main issue is, why does it says "log does not need rotating" ?
Thanks
Ashish
This is test that I have set up on our test server. To actually see logs being rotated, I have set it up for daily rotation.
Once I have it working properly I will change the frequency and save time.
Did not understand your comment about script. Are you saying I do not need postscript at all?
My main issue is, why does it says "log does not need rotating" ?
Thanks
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2004 08:25 AM
04-02-2004 08:25 AM
Re: Log Rotate does not rotate log files
I have never used that script, but it is much easier to do this than that script makes it.
Just make a cron script do an arbitrary cp of the log file every X days. Might be a bit simplistic but it shouldn't be hard.
cp syslog.log.bak3 syslog.log.bak4
cp syslog.log.bak2 syslog.log.bak3
cp syslog.log.bak1 syslog.log.bak2
cp syslog.log syslog.log.bak1
> syslog.log
hehe... I agree with the script output. "Your log does not need to be rotated".
Im still not sure the business reason you are doing this. Other than to sharpen your scripting skills.
Just make a cron script do an arbitrary cp of the log file every X days. Might be a bit simplistic but it shouldn't be hard.
cp syslog.log.bak3 syslog.log.bak4
cp syslog.log.bak2 syslog.log.bak3
cp syslog.log.bak1 syslog.log.bak2
cp syslog.log syslog.log.bak1
> syslog.log
hehe... I agree with the script output. "Your log does not need to be rotated".
Im still not sure the business reason you are doing this. Other than to sharpen your scripting skills.
Unix, the other white meat.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP