Giter VIP home page Giter VIP logo

coreprotectdataoptimizer's Introduction

CoreProtectDataOptimizer

Optimize and clean up your CoreProtect Minecraft plugin database with ease, significantly reducing disk space usage by removing non-player-generated data from over a month ago.

PyCheck

简体中文 | English

Requirements

  • Python 3.7+
  • MySQL 5.7 or higher

Features

This script cleans non-player data from the co_block table, including data generated by automation devices. It specifically targets data older than a month, effectively reducing the database size from 1.5 billion to 40 million rows in our tests.

Why Not Use co purge?

In the CoreProtect database, the co_block table occupies the most space, yet the majority of its data is non-essential, with only a small fraction generated by player activities.
By cleaning up this data, we not only free up disk space but also preserve valuable player-created blocks and other activity data.
Using co purge would indiscriminately remove all data prior to a specified date, including player actions, sign records, chat logs, and more.

Setting Up

To prepare your environment for running this script, you should create a virtual environment and install the required packages:

# Create a virtual environment
python3 -m venv venv

# Activate the virtual environment
# On Windows
venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activate

# Install the required packages
pip install -r requirements.txt

Usage

To run the script, use the following command in your terminal, making sure to replace path/to/your/config.ini with the actual path to your configuration file:

python main.py --config path/to/your/config.ini

After running the script, consider using the OPTIMIZE TABLE command on your MySQL database to reclaim the freed disk space.

License

GPL-v3

coreprotectdataoptimizer's People

Contributors

angelkawaii2 avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.