Useful Saves

Useful Saves

1.2k Downloads

Scheduler backing up to never lose anything !

Useful Saves, a simple, commands only, mod to create scheduled backup of your world or extras files

Not mandatory on the client, it could be only installed on the server !

Features

  • Scheduled saves
  • Instant backup
  • Delete backup
  • Cleaning backup folder
  • Crontab helper command

Config example

[common]
	#Print Useful Saves messages in chat ?
	printMessage = true
	#Define a TimeZone if server clock mismatch players clock
	#Automaticly generated by default
	timeZone = "Europe/Paris"
	#Define a json formatted cron task to save/load
	#If "enableTaskOnServerStart" is enabled task will be loaded.
	cronTaskObject = "{}"
	#Define maximum created backups
	#"-1" = unlimited saves
	#Range: > -1
	maximumSavedBackups = -1
	#Enable the previous saved scheduled task on server start ?
	#Ensure "cronTask" is not empty or null
	enableTaskOnServerStart = true
	#Define a backup folder
	backupsFolder = "./backups"
	#Process save task if no player connected ?
	saveIfServerEmpty = true
	#Define a list of files or folder to save on saving process
	#Use absolute path !
	savedFileWhitelist = ["./logs", "./config"]
	#Defined to delete oldest backups if maximum saves are reach
	#Used if "maximumSavedBackups" are defined
	deleteOldOnMaximumReach = false

Commands

Useful Saves’s command prefix are always /useful-saves

- Deletions commands

/useful-saves clear-backups-folder Clear save files from backup folder

/useful-saves delete Delete a specified save file from backup folder

/useful-saves confirm [yes/no] Confirm previous deletion


- Scheduling commands

/useful-saves schedule stop/pause/resume To stop, pause or resume the current running task

/useful-saves schedule cron [<expression>] To schedule backup task, based on crontab expression

Optional parameters

/useful-saves schedule cron [<expression>] [<TimeZone>] To schedule backup task, based on crontab expression, but by defining a time zone if the server clock/locale differ from user contry

/useful-saves schedule cron [<expression>] [flush] flush backup file. (force writting data)


- Utilitary commands

/useful-saves schedule restart Restart the scheduler system in case of any crash or shutdown

/useful-saves save-now Launch an instant backup

/useful-saves info Informations of the actual state of the scheduler


- Config commands

/useful-saves config backupFolder Define a folder to store saves

/useful-saves config deleteOldOnMaximumReach Delete oldest save if maximum backups reached

/useful-saves config enableTaskOnServerStart Starting scheduled task on server start

/useful-saves config maximum-backups Set the number of backups the server keeps

/useful-saves config printChatMessage Display or not infos to all players

/useful-saves config saveIfServerEmpty Enable saves if server has no players connected

/useful-saves config timeZone Define a time zone if the server clock/locale differ from user contry

Crontab Helper command

Useful Saves are packaged with an human interpreter for cron expression

Thanks to cronexpressiondescriptor.azurewebsites.net

/cron [<expression>] Get a human readable version of the cron expression

/cron [<expression>] [<locale>] Get a human readable version of the cron expression, but in user language

Example: /cron "*** * * ? * ***" fr-FR

Output: Toutes les secondes

Resources packs or Mods packs maker ?

If you don't want Useful Save installed on the client, but only on the server it's possible ! But bring translations files for printted messages in tchat ! Download the translations pack of "Useful Save" ! resources/assets/usefulsaves/lang

Useful links

If you are not familiar with crontab let’s check Cron Expression Generator for Quartz !

Technologies used