Plesk

Access logs are not rotated on Plesk server: Rotation of files with multiple hard links is not allowed

Symptoms

Cause

Product issues:

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.

  1. Connect to the Plesk server via SSH.

  2. Use the following command to apply the option to all logrotate configuration files:

    # sed -i '/copytruncate/a allowhardlink' /usr/local/psa/etc/logrotate.d/*

  3. 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