How to change log rotation settings for all domains at once

Created:

2016-12-12 03:38:58 UTC

Modified:

2017-08-16 16:08:47 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to change log rotation settings for all domains at once

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Windows
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Question

How to change log rotation settings for all domains at once?

Answer

It can be performed using Plesk command line utility or Plesk API-XML request:

  1. Change log rotation settings using domain command line utility

    For Linux The following command changes log rotation setting for all domains:

        # for dom_name in $(mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -sNe "select name from domains;"); do /usr/local/psa/bin/domain -u $dom_name -log-bytime weekly; done

    This command is switching log rotation condition to By time and sets log rotation period as 1 week . Get an additional information about the plesk bin domain utility options by the following command:

    # plesk bin domain --help

    For Windows Please use the attched file in order to change log rotation setting for all or several websites.

    Unzip the .bat file, run it as Administrator and follow the instructions inside.

  2. Change log rotation settings using Plesk API request . Send the API request to Plesk using the Send API request website. In the following example, XML API request changes log rotation setting for all domains of admin account

    <packet version="1.6.3.0">
    <log-rotation>
    <set>
    <filter>
    <owner-id>1</owner-id>
    </filter>
    <settings>
    <log-condition>
    <log-bytime>Weekly</log-bytime>
    </log-condition>
    </settings>
    </set>
    </log-rotation>
    </packet>

This API request switch log rotation condition to By time and sets log rotation period as 1 week .

Attachments:

Have more questions? Submit a request
Please sign in to leave a comment.