ServerMod / MultiAdmin

SCP: Secret Labratory Server modification to support different configs per instance plus a whole lot of other features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automated log Archiving (Enhancement)

joker-119 opened this issue · comments

When MA starts an SL server, there should be a configurable option to have MA check the size of that server's log folder (both by total disk size, aswell as number of files present), and if it exceeds a certain (configurable) threashold, it should archive all of the existing log files for said server into a .rar, .tar.gz or (for maximum space efficiency) a .tar.xz. The file time should probably default to .rar, but be configurable by the host.

This can help prevent log folders from reaching massive sizes over long term use of an SL server, without the user having to go in and manually clear them out.

There should also probably be an option to simply delete the old log files, instead of archiving them.

I currently don't have access to my PC (won't for another 5-6 days) otherwise I'd make a PR to add this myself, and if you like, would be more than happy to do so when my PC is back up and running.

.rar is impossible to create cuz it's a closed format, all tars and xz need an external dependency, only zip would work out of the box

Fair enough, .zip out of the box, would including an option to use tars still be viable if it's noted that it will only work if the external dependency is installed?
Even if .zip can be the only format supported, I believe it would be beneficial to cut down on extraneous log folder sizes without having to manually archive/delete them.

And i suggest add automated clear old logs

Because the logs were able to take up 143 GB of space

Well that's kind of the purpose of archiving them, make them take less space. But automated cleanup of very old logs would also be nice