Skip to content

Rollback

DeathTech edited this page Jan 19, 2017 · 10 revisions

Rollback+ is an automated database backup system released here on github for the game "Screeps".

It has the following features:

  • -Automated backups on a preset time basis.
  • -Manual backups
  • -Rollback to a previous state.

Configuration

  • enableAutoBackup = 1
    Controls if the system automatically starts auto backup chronjob
  • enableAutoStart = 1
    Controls if the game automatically restarts after a rollback.
  • backup_type = "time"
    Controls if backups should be done based on a real time interval or in-game tick. (Currenly only time works)
  • backup_frequency = 600
    Controls frequency of backups in seconds or ticks (ticks don't work atm)
  • backup_format = "%u-%Y-%M-%D-%h-%m-%s"
    Controls backup output format, for format explanations see command format() below
  • TBRBA = 5000
    Time to delay between actions for rollback and backup.
    Increase number if a big database is present.

Caveats

1

Currently the system can only select a target database for rollback once.
Afterwards any further executions of the restore command will only restore the same file over an over again.
This behaviour will not stop regardless of corrupting or removing the loaded database file.
The only way to select a different target is to restart the server or the cli interface.

2

Because the current released version is a test version full zone detection is not yet build in so the mod demands to be at least in one subdirectory. Mainly it assumes to be in a folder called "mods".

Commands

backup(string foldername)

This command manually backs up the game progress to the named folder.

startauto()

This command manually initiates the backup system in case you did not activate it in config.

restore(string foldername)

This command restores the server to a previous state by finding the backup by foldername and then loading that in.

format(string foldernamedformat)

A test command to pre-test formatting.
Following can be used to format the name:
Any strings you want to add.
%D = day
%m = minute
%M = month
%s = second
%Y = year
%h = hour
%t = time since Jan 1 1970
%u = unix timestamp (%t in seconds)
example: ServerA-%Y-%M-%D-%h-%m-%s-%t -> ServerA-2017-18-3-21-58-26-1484776706179

Clone this wiki locally