• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Log rotation not work

ManuG2k

Basic Pleskian
Hi,
I have Plesk 11.0.9 Update #54 on Ubuntu Server 12.04.2 LTS

My log rotation settings not work :\
I have
Log rotation condition set to by time (daily)
Maximum number of log files: 730
Compress log files: check


But the logs are added to access_log.processed


Can you help me ?
 
The access_log.processed contain many day logs, not only last day.
On another server (same ubuntu server and plesk version), log rotation work correctly and I have many access_log.processed, day by day.
 
Have you tried to run it manually with

/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

Also check logrotation settings in config files

/usr/local/psa/etc/logrotate.conf
/usr/local/psa/etc/logrotate.d/
 
Have you tried to run it manually with

/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

Also check logrotation settings in config files

/usr/local/psa/etc/logrotate.conf
/usr/local/psa/etc/logrotate.d/

Hello IgorG,
I have run manually "/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php" and I got no errors.
I check /usr/local/psa/etc/logrotate.d/
and this is an example:


#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
/var/www/vhosts/mywebsite/statistics/logs/*.processed {
daily
rotate 730
compress
missingok
}
/var/www/vhosts/mywebsite/statistics/logs/error_log {
daily
rotate 730
compress
missingok
copytruncate
}
 
What sort of output

# logrotate -v /usr/local/psa/etc/logrotate.conf

for access_log of mentioned domain?
 
What sort of output

# logrotate -v /usr/local/psa/etc/logrotate.conf

for access_log of mentioned domain?

The problem is on all domains.

The output (of command "logrotate -v /usr/local/psa/etc/logrotate.conf" ) is this:

reading config file mydomain
rotating pattern: /var/www/vhosts/mydomain/statistics/logs/*.processed after 1 days (730 rotations)
empty log files are rotated, old logs are removed

But (for all domains) the logs from access_log are put to access_log.processed (and this file contain many days).
I see another problem: on folder /usr/local/psa/etc/logrotate.d/ not there are all my websites I have in plesk o_O
 
I'm pretty sure this is a bug :(
On another server (with plesk 11.0.9 Update #54) the last domains that I added in the month of May 2013, are suffering from this problem of log rotation, and on that server, logs older than one day have been completely lost.
An update of Plesk on may is a cause of this, I think :\
 
I can't reproduce it on my test Plesk server.
Compression of access_log.processed depends on Log rotation condition 'by size' in logrotation settings of domain. If size of access_log.processed is not more than this parameter - log will not be compressed.
For example, I set it to 1 kb and:

# ls -la /var/www/vhosts/tttest.gov/statistics/logs/
total 60
dr-xr-x--- 2 root psaserv 4096 Jun 21 11:23 .
dr-xr-x--- 7 root psaserv 4096 Jun 21 11:17 ..
-rw-r--r-- 1 root root 43474 Jun 21 11:23 access_log
-rw-r--r-- 1 root root 242 Jun 21 11:21 access_log.processed
......

As you can see, size of access_log more than 1 Kb. After that I started maintenance script:

# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

Now access_log.processed is compressed because size of this file was more than 1 kb:

# ls -la /var/www/vhosts/tttest.gov/statistics/logs/
total 16
dr-xr-x--- 2 root psaserv 4096 Jun 21 11:24 .
dr-xr-x--- 7 root psaserv 4096 Jun 21 11:17 ..
-rw-r--r-- 1 root root 0 Jun 21 11:24 access_log
-rw-r--r-- 1 root root 2196 Jun 21 11:24 access_log.processed.1.gz
 
I found this happening on my Linux server. The logs on most of the domains were not rotating daily as they were set to. I took a look at the /usr/local/psa/etc/logrotate.d folder and found only a handful of domains in there, and those were the ones that were rotating properly. When I disabled and then re-enabled the log rotations on a domain it added the domain to the folder. So I have gone through and done this for each site that wasn't rotating properly. I'll have to check and make sure they rotate when they are supposed to but I'm pretty sure they will. I'm not seeing the same issue with my Windows server.
 
Back
Top