- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- logrotate
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
03-19-2008 04:31 PM
03-19-2008 04:31 PM
i would like to logrotate system logs /var/log/* every day and delete 7 days older logs.
this is not happening in my linux machine. logs are getting rotated every day but 7 days older logs are not getting deleted.
could you please let me know what could be the issue.
logrotate.conf
--------
# see "man logrotate" for details
# rotate log files weekly
daily
# keep 7 days worth of backlogs
rotate 7
# create new (empty) log files after rotating old ones
create
# Rotate log if it is bigger than SIZE
#size=100M
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
/var/log/kern.log /var/log/debug /var/log/auth.log /var/log/daemon.log /var/log/messages /var/log/user.log /var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn /var/log/uucp.log /var/log/faillog /var/log/dmesg {
daily
create 0640 root logadm
postrotate
/etc/init.d/syslog restart
endscript
rotate 7
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-19-2008 07:51 PM
03-19-2008 07:51 PM
Re: logrotate
ogrotate.conf
--------
# see "man logrotate" for details
# rotate log files weekly
# daily
weekly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-20-2008 03:58 AM
03-20-2008 03:58 AM
Re: logrotate
also in my problem how does changing to weekly will help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-20-2008 04:37 AM
03-20-2008 04:37 AM
SolutionLog rotate will rotate the files at the interval specified. If you specify "daily" and "rotate 6", you will have 6 copies of your log files rotated daily, that is, the 6 most recent, or 6 days.
If you specify weekly, and rotate 1, for example, you will have one log file containing logs for the entire week.
Probably I understand wrong your first post. How many logs do you have in your log directory with "daily" and "rotate 7" options?
Have you manually added the section under:
# system-specific logs may be also be configured here.
This should be not neccesary as in /etc/logrotate.d, which is included in the configuration file, you have the syslog configuration file which rotates system logs.
You can force a rotation with:
logrotate -f /etc/logrotate.conf
Check also /var/lib/logrotate.status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-20-2008 10:57 AM
03-20-2008 10:57 AM
Re: logrotate
my configuration was correct but while testing i was not using -f option.
thanks again..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-13-2008 04:38 AM
05-13-2008 04:38 AM
Re: logrotate
I'm a new guy to linux, and trying to create a log rotation for one of my logs, can you tell me how to do this... I have tried so many site with their comments..
Location of my file : /usr/local/lbx/xl_wat/wasp65/bin/output.log
please help me...
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP