Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to set up log storage for a long term in Plesk?

 
crondatabasedebuggoip

Question

The local laws of my country require storing all server logs for a long period. How do I set up storing of websites' logs for years in Plesk?

Important

  • Plesk recommendsnot to disable log rotation and not to store log files for a long period, because it may cause overuse of the disk space and affect the server performance.
  • Please note that when a website is removed, its logs are removed as well. To prevent that from happening, store required log files on a remote/external storage or a database. Third-party log management software or a bash script provided below can be used for this.

Answer

To set up a non-standard period of log storage, apply the following:

  1. To keep sensitive data safe, disable the IP addresses anonymization in Plesk: Go to Tools & Settings > Server Settings, clear the Anonymize IP addresses during log rotation and collecting of web statistics checkbox and click OK:

  2. Download and configure the actual version of archive-logs.sh script.

    Note: the corresponding repository may be found here.

  3. Set a scheduled task to run a script in a periodic manner.

  • Here's how the typical script setup steps look like:

    # # make sure the script is executable
    # chmod +x archive-logs.sh
    # # check help
    # ./archive-logs.sh --help
    # # create a config from sample
    # ./archive-logs.sh -s > config.sh
    # # edit it to suite your environment and target storage
    # # execute the script with the config to check everything works as expected
    # ./archive-logs.sh -c config.sh -l debug
    # # add the command to root cron with desired period: "/path/to/archive-logs.sh -c /path/to/config.sh"
    # # note that "-c /path/to/config.sh" can be skipped if the file is in the same directory as the "archive-logs.sh" script

Find detailed instruction on how to use the archive-logs.sh script below.

Script

How it works

By default, this script collects all known logs of the server, Plesk, and websites. You can view the list of the collected logs right in the script and modify it in a configuration file if required.

To get a list of available options, run the script with the --help option:

# ./archive-logs.sh --help
Usage: archive-logs [OPTIONS]
Collect and transfer logs for long-term storage.

-c, --config CONFIG
Use this config…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

How to Host a Go App on Plesk

Read More »

Cron Jobs: All You Need To Know

Read More »

Plesk with Centralized Database and Network File System

Read More »
Knowledge Base

How to keep/store logs for years in Plesk for Windows?

Read More »

Incoming mail to a Plesk server gets rejected: Client host blocked using zen.dnsbl

Read More »

Unable to remove a certificate in Plesk: One or several certificates are assigned to the IP addresses or domains

Read More »

Unable to log into Webmail on Plesk with Dovecot: Connection to storage server failed

Read More »

Hosting Wiki

  • Django
  • Server Redundancy
  • Google Cloud CDN
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • MongoDB
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • UDP/IP
  • Cron Jobs
  • TCP/IP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family