It would be nice to have a PRE_SAVE_SCRIPT / PRE_SAVE_SCRIPT_FILE environment variable where the script is executed before "/save-off". Most of the time when the server executes a "/save-all" it freezes the server for a few seconds. I would be nice to be able to announce to the players, "Server Backup starting in x seconds". Another use cases might be to perform cleanup task like removing drop entities with "/lagg clear", etc... It would be nice to also add a POST_SAVE_SCRIPT but spot is already taken by POST_BACKUP_SCRIPT. I don't know if it would be a breaking change to swap the order of POST_BACKUP_SCRIPT and "/save-on".
That seems like reasonable additions. Like you said, just need to confirm the sequence of those with other operations. That would be great if you could PR this.
It would be nice to have a PRE_SAVE_SCRIPT / PRE_SAVE_SCRIPT_FILE environment variable where the script is executed before "/save-off". Most of the time when the server executes a "/save-all" it freezes the server for a few seconds. I would be nice to be able to announce to the players, "Server Backup starting in x seconds". Another use cases might be to perform cleanup task like removing drop entities with "/lagg clear", etc... It would be nice to also add a POST_SAVE_SCRIPT but spot is already taken by POST_BACKUP_SCRIPT. I don't know if it would be a breaking change to swap the order of POST_BACKUP_SCRIPT and "/save-on".
If this gets added the lines
should probably be moved inside the while loop to make sure that PRE_SAVE_SCRIPT doesn't get called if the server is offline