Azami7 / Ollivanders2

Updated version of the Ollivander's plugin for Spigot
11 stars 4 forks source link

Pull Request for automatic or manual purging of plugin data #479

Closed Eurphus closed 2 years ago

Eurphus commented 2 years ago

I noticed plugin data can accumulate really quickly with hourly backups, but it is still a useful tool to have that I would not like to turn off. However it becomes an issue when there's hundreds (eventually thousands of files) which needlessly take up space. Code from this merge introduce the ability to automatically or manually purge old plugin data.

Azami7 commented 2 years ago

I am not really comfortable with the plugin deleting files from someone's server - a bug in that could be bad. I recommend people set up cron jobs to rotate log files to prevent accumulation. Or, having a backup frequency setting so people could choose less frequent than hourly to generate less files.

Eurphus commented 2 years ago

Understandable, although there is very little room for error. The plugin cannot delete anything from outside the archive folder and by default this will be disabled. /Olli purge would still be possible, but I will add an option to disable it entirely and that would be the default (-1 in the config). This has been tested a lot, since I'm using this on an important production server as well.

If you for sure don't want it, close the request, if you do still in some form I can rework it and add some features onto it like entirely disabling it by default. I can also remove the scheduler and just keep the command if needed.

I will also look into changing how often plugin data is saved, and let that be configurable as well.

Azami7 commented 2 years ago

Deleting logs like this is an anti-pattern and a bug this functionality could have serious impacts. Log rotation set up by the server admin is the approach we recommend.

You can certainly fork this in to your own build if it is functionality you want to maintain for yourself.