Sign inSign up

passivelemon/terraria-backup-docker

By passivelemon

•Updated over 1 year ago

Side-car Docker container to backup terraria-docker

Image
Integration & delivery
1

1.2K

passivelemon/terraria-backup-docker repository overview

⁠terraria-backup-docker⁠

Side-car Docker container to backup terraria-docker⁠.

Warning

This is container alone is NOT a substitute for a proper backup solution. If losing data would cause you trouble, please, take proper care of it.

⁠Quick setup

  1. Mount your Terraria world directory.
  2. Run the container: (Make sure to modify any values that you need.)
  • docker run -d --name terraria-backup -v /opt/TerrariaServer/Worlds/:/opt/terraria-backup/worlds/ passivelemon/terraria-backup-docker:latest

⁠Setting up the container

This will loop over all worldnames in the world directory and back up the world files associated with that name. The backups are placed in a Backups subdirectory in the same directory as the world files.

⁠Environment variables

VariableOptionsDefaultDetails
PUIDinteger1000The UID to run the script with.
PGIDinteger1000The GID to run the script with.
CRONTIMEcrontime (* * * * *)0 1 * * * (Every day at 1 AM)The cron time that the container follows for the backup schedule.
STARTTRIGGERboolean0Whether to run the backup upon container start.
METHODcp tar zip 7zipcpThe method of storage to use when backing up. More details below.
ROTATIONSinteger5How many backups to rotate through.
MethodFunction
cpCopy to backup location. This is the default.
tarArchive (with gzip) to backup location.
zipZip to backup location.
7zip7Zip to backup location.
⁠Docker run
docker run -d --name <container name> -v <world dir>:/opt/terraria-backup/config/ passivelemon/terraria-backup-docker:latest
⁠Docker Compose
services:
  terraria-backup-docker:
    image: passivelemon/terraria-backup-docker:latest
    container_name: terraria-backup-docker
    volumes:
      - <world dir>:/opt/terraria-backup/worlds/

⁠Examples

⁠Docker run
docker run -d --name terraria-backup-docker -v /opt/terrariaServer/Worlds/:/opt/terraria-backup/config/ -e METHOD="tar" -e STARTTRIGGER="1" passivelemon/terraria-backup-docker:latest
⁠Docker compose
services:
  terraria-backup-docker:
    image: passivelemon/terraria-backup-docker:latest
    container_name: terraria-backup-docker
    volumes:
      - /opt/terrariaServer/Worlds/:/opt/terraria-backup/worlds/
    environment:
      METHOD: 'tar'
      STARTTRIGGER: '1'

Tag summary

Content type

Image

Digest

sha256:772d2d390…

Size

11 MB

Last updated

over 1 year ago

docker pull passivelemon/terraria-backup-docker