ServerLogSaver
ServerLogSaver
Description
Simply put, this will backup the server.log file to a directory, and then clear the existing server.log file. This is to reduce RAM usage of the server host and effectively reduce lag for server players.
Most of the functions in this are configurable, such as backup location, time delay between backups, choice of Size and Time rotations and more!
Download the Jar
- ServerLogSaver v2.1.1
- ServerLogSaver v2.1.0
- ServerLogSaver v2.0.2
- ServerLogSaver v2.0.1
- ServerLogSaver v2.0
Download the Source
Old Source ServerLogSaver src v0.1b
Commands
- /sls copy
- /sls zip
Current Features
- User defined time for backup intervals (default time is 1 day, 1440 minutes)
- Backups are time stamped for ease of use
- Compress the logs
- Check for 0 byte content
- Console notice (optional)
- Choice of time/size/restart rotations (Time in minutes/Size in KB/Restart only backs up on server start)
- User defined backup storage location
- User defined backup file names (prefix and time setup)
- In-game command to do backups on will
- Choose the number of logs to keep before purging
To-Do
- Record commands used in a separate file (Probably make a separate plugin for this)
- need more ideas, feed back would help :D
Change-Log
Version 2.1.1
- Updated to 1.2.5 R4.0
Version 2.0.2
- No longer backs up as soon as the server starts with 'time' rotation
Version 2.0.1
- Added 'restart' rotation choice
Version 2.0
- Complete re-code
- Added in-game commands
- Updated to latest config
@GioboiMC
Errrr, i just tested with the newest dev build (#2041 for 1.2.3) and it works perfectly fine. What exactly doesn't work about it for you?
Doesn't work.. Please update!
@Royalgamer06
As @Kloporte said, it is still working and functional with the latest 1.2.3 dev CB builds (most recently tested with #2037)
@Royalgamer06
The v2.1.0 works with the beta build so far
@Kloporte
I think i know what you mean and i believe this could be done through changing the priority of SLS's onEnable() method.
But like i said before, i will not be adding any more features. It works perfectly well as it is and was recently changed so it no longer backed up logs as soon as it started, by many requests, but instead now waits the specified time to backup on the very first backup since reload/restart.
If you (or anyone else for that matter) are wondering why im stopping adding features to most of my plugins, it is because i have just begun my first year of University and don't have time to constantly be thinking about new things to add or how to add requested features. Instead i will simply maintain and make sure all my plugins are up to date.
Hi, could you modify the reload type so each backup log begins with the actual server start line. A backup sould start with the actual server sart line (the line with Starting minecraft server) and end just before the start of the running instance.
The problem is you back up the log just after the plugin is enable but several other plugins are already started. I understand that will be more complex for you because you'll have to search for the string "Starting minecraft server" in previous lines...
Exemple for now :
Backup log :
Running log :
And what i think it should be :
Backup log :
Running log :
I'm not sure what i said is clear, i hope you'll understand me and my poor english.
@rebel24
When R5 comes out, sure thing. That is if it breaks with R5 since its not exactly heavily dependent on the craftbukkit API
Update to R5 before you leave?
@bootscreen88
The source is in the .jar. Just use a decompiler and check it out.
can you post the current source so i can take a look before i say that i can add some features?
Sorry everyone but i believe i will no longer be adding new features to this plugin. I will however keep maintaining it and keep it up to date. If someone else wants to come on as an author to keep adding new features to this plugin just PM me.
This plugin will not be dying but simply not being furthered with new features (unless someone else comes on or i get time to do them).
Version 2.1.0 is here with an automatic log clear system (thanks to bootscreen88) which allows you to choose the max backups before it starts to clear old ones.
DL is here
Will be hopefully adding the other requested feature (day, week and month rotations) tomorrow or when i get back from work.
Yes, this is exactly what I mean :)
@bootscreen88
Seems like a good idea. Not sure why you put the code at the bottom for splitting the backups days. Are you implying that it could possibly have more than one day that it backs up? So for instance:
And it will back up on those days at 12pm?
thanks for adding it so fast.
and i'll try to explain it again ^^
currently you have time, size and restart. and what i would to say is to add things like day, week and month.
I'll try to explain it by some examples:
RotationChoice: day BackupHour: 22 BackupMinute: 30 so your plugin does the Backup every day on 22:30 (10:30pm) it is to calculate as with time intervall 1440 because this can slide when the server is offline.
RotationChoice: week BackupDay: 1 (1 = Monday, 2 = Tuesday, etc) BackupHour: 1 BackupMinute: 0 this means that the backup is on every monday on 01:00 (01:00am) (when its possible than you can set multiple days in BackupDay and split the Value, when you don't know how i'll post 2 lines at the and which can do this)
RotationChoice: month BackupDay: 2 ( the number means the number of the month, when its over the max days of the current month use the max days of the month.) BackupHour: 21 BackupMinute: 20 this means that the backup is on every second day of the month on 21:20 (09:20am)
I hope i'll explain it understandable ^^
here is the java code for splitting the BackupDays
@bootscreen88
Well i believe i have the "does not backup on startup" done, but im not entirely sure i understand what your other idea is about.
Are you saying that you wanna specify a particular day of the year that it will backup on?
sorry, but i was sleeping when you post your answer ^^
both things are right, but for the second there is no solution because you can't clear the log before the server starts ^^
the second one is actually the reason for the first one.
and at night i get an additional idea can you add an option for day, week and month? day with an option for a specific time, week with an option for time and day of week (1-7) month with an option for time and day of month (1-27 because the shortest month is the februar with 27 days)
@bootscreen88
So what i gathered from this is:
If its the first then i would happily do this for you as it wouldn't be too difficult
If its the second the only way around this i can see is to add an extra delay on the scheduler.
Hope you reply soon so i can work on this asap. :D
laserhog?
is it possible to disable the log clear on the serverstartup? i have to "problems" with it. the first is: on every start it splits the startup log (when every plugin is loading). circa the first 300 lines were backuped and cleared from your plugin and the rest would leaved. and the second problem is when i test new plugin or setting up a new config, the logclear is annoying.
the only problem i could see is the timed setting when the server gets a daily restart. but to solve this you could set a timestamp in the config everytime the server cleared the log. and on startup you could check this and set a scheduled task with a delayed start. the delayed time is the BackupTime - the time since the last backup. or you set an aditional option to set a date and time when the log should be cleared.
i hope you can understand me. my english isn't realy good even less at 2 am ^^
Thank you for adding the "restart-only" rotation to 2.0.1 ^^