Symptoms
-
Log rotation doesn't rotate logs, resulting in no compressed
.gz
files being created. -
Forcing log rotation for specific domain results in error
# /usr/local/psa/logrotate/sbin/logrotate -v -f /usr/local/psa/etc/logrotate.d/example.com
(...)
considering log /var/www/vhosts/system/example.com/logs/access_log.processed log /var/www/vhosts/system/example.com/logs/access_log.processed has multiple (2) hard links. Rotation of files with multiple hard links is not allowed for /var/www/vhosts/system/example.com/logs/*.processed -- skipping.
(...)
Cause
Product issues:
-
#PPPM-13473 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.42."
Fixed in:- Plesk Obsidian 12 April 2022 (Linux)
-
#PPPM-13519 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.43 even if /usr/local/psa/etc/logrotate.conf was customized."
Fixed in:- Plesk Obsidian 24 May 2022 (Linux)
- #PPPM-13562 reported but not solved.
Resolution
Please consider updating your server:
Workaround
If update is not possible for some reason, you may try the following
It is possible to use the sed
command to add allowhardlink
option to all logrotate config files.
-
Connect to the Plesk server via SSH.
-
Use the following command to apply the option to all logrotate configuration files:
# sed -i '/copytruncate/a allowhardlink' /usr/local/psa/etc/logrotate.d/*
-
Force rotation:
To rotate logs for a single domain:
# /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com
To rotate logs for all domains:
# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php -f ExecuteStatistics