Help - Search - Members - Calendar
Full Version: logrotate hourly for one site
The Planet Forums > System Administration > General Support Questions
fooman
One of the sites in the server has lots of access and
the size of access_log grows very fast.
It reaches 2GB before daily log-rotating(it is at 4:00am), and apache dies.

Anyone please teach me how to rotate the access_log hourly for one site?(for example, only for site5)

My server is ensim3.1 with Redhat

I copied "logrotate" located in /etc/cron.daily
to /etc/cron.hourly but no luck..

I copied "logrotate" located in
/home/virtual/site5/fst/etc/cron.daily/ to
/home/virtual/site5/fst/etc/cron.hourly/ but no luck..

I also edited crontab and add the line below.
01 * * * * root run-parts /home/virtual/site5/fst/etc/cron.hourly but no luck..
JFrechA
QUOTE (fooman)
One of the sites in the server has lots of access and  
the size of access_log grows very fast.
It reaches 2GB before daily log-rotating(it is at 4:00am), and apache dies.

Anyone please teach me how to rotate the  access_log hourly for one site?(for example, only for site5)

My server is ensim3.1 with Redhat

I copied "logrotate" located in /etc/cron.daily  
to    /etc/cron.hourly  but no luck..

I copied "logrotate" located in  
/home/virtual/site5/fst/etc/cron.daily/  to  
/home/virtual/site5/fst/etc/cron.hourly/   but no luck..

I also edited crontab and add the line below.
01 * * * * root run-parts /home/virtual/site5/fst/etc/cron.hourly   but no luck..


Let all the files where they are. Edit the logrotate.conf at the site 5.

# pico /home/virtual/site5/fst/etc/logrotate.conf

I hope this is your solution.

JFrech
fooman
I edited
/home/virtual/site5/fst/etc/logrotate.conf
"daily" to "size=50M"
to male it rotate when the log reachs 50M of size.
but no luck..
anyone?
JFrechA
QUOTE (fooman)
I edited  
/home/virtual/site5/fst/etc/logrotate.conf
"daily"  to  "size=50M"
to male it rotate when the log reachs 50M of size.
but no luck..
anyone?


Below is the conf of one of my sites. The line you need to edit is in bold.
After you edited the file, restart the logrotate.d

# configuration file automatically generated by Ensim Webppliance
# Please do not edit this file manually.
# *** ALL CHANGES WILL BE LOST ***
#
# see "man logrotate" for details
#

# compression of logs enabled
# compress

# frequency of log rotation
daily


# create new/empty log files after rotating old ones
create

# maximum log file size
size 64M

# no error if log file(s) are missing
missingok

# no email sent if log is rotated out-of-existence
nomail

# keep 5 days worth of backlogs
rotate 5

delaycompress

include /etc/logrotate.d
fooman
Mine is exactly the same with you.
but the access_log reaches 2GB of size within 24 hours and apache dies. i want to rotate hourly or at a certain size.
so I changed "daily" to "hourly" or "size=50M"
but no luck..
JFrechA
QUOTE (fooman)
Mine is exactly the same with you.
but the access_log reaches 2GB of size within 24 hours and apache dies.  i want to rotate hourly or at a certain size.
so I changed "daily" to "hourly" or  "size=50M"  
but no luck..



Verify if your cron is working fine. Also, do a manual logrotate to see if it is functioning well.

JFrech
fooman
cron is working fine.
I did manual rotate by
#chroot /home/virtual/site5/fst/
/usr/sbin/logrotate /etc/logrotate.conf
It works fine but the log keeps be in "access_log.1" now.
"access_log" keeps empty untill 4:02am(cron.daily)
Anyone?
JFrechA
QUOTE (fooman)
cron is working fine.
I did manual rotate by
#chroot /home/virtual/site5/fst/
/usr/sbin/logrotate /etc/logrotate.conf
It works fine but the log keeps be in "access_log.1" now.
"access_log" keeps empty untill 4:02am(cron.daily)
Anyone?



Apparently your logrotate isn't working well at all. In the link below, you can find a script that could be your solution

http://forums.ev1servers.net/showpost.php?...179&postcount=3

JFrech
fooman
Logtotate is working fine at 4:02am daily. Access_log is renamed to access_log1, and new access_log starts logging. Manual logrotate seems not doing this job somehow.
I want make it hourly. or rotate by certain size.
fooman
anyone?
TMX
Restarting syslog should get logrote writing to the correct logfile again. ie;, run logrotate and then restart syslog
service syslog restart

-Bob
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.