- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- logrotate
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
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
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
тАО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
- 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
- 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
- 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
- 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
- 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...