https://github.com/passivelemon/terraria-backup-docker
Side-car Docker container to backup terraria-docker
https://github.com/passivelemon/terraria-backup-docker
backup docker docker-compose terraria terraria-server tmodloader tmodloader-server
Last synced: 3 months ago
JSON representation
Side-car Docker container to backup terraria-docker
- Host: GitHub
- URL: https://github.com/passivelemon/terraria-backup-docker
- Owner: PassiveLemon
- License: gpl-3.0
- Created: 2024-05-18T22:38:14.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-23T00:44:39.000Z (4 months ago)
- Last Synced: 2025-02-23T01:27:34.641Z (4 months ago)
- Topics: backup, docker, docker-compose, terraria, terraria-server, tmodloader, tmodloader-server
- Language: Shell
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [terraria-backup-docker](https://github.com/PassiveLemon/terraria-backup-docker)
Side-car Docker container to backup [terraria-docker](https://github.com/PassiveLemon/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
| Variable | Options | Default | Details |
|:-|:-|:-|:-|
`CRONTIME` | `crontime (* * * * *)` | `0 1 * * * (Every day at 1 AM)` | The cron time that the container follows for the backup schedule.
`STARTTRIGGER` | `boolean` | `0` | Whether to run the backup upon container start.
`METHOD` | `cp` `tar` `zip` `7zip` | `cp` | The method of storage to use when backing up. More details below.
`ROTATIONS` | `integer` | `5` | How many backups to rotate through.| Method | Function |
|:-|:-|
`cp` | Copy to backup location. This is the default.
`tar` | Archive (with gzip) to backup location.
`zip` | Zip to backup location.
`7zip` | 7Zip to backup location.### Docker run
```
docker run -d --name -v :/opt/terraria-backup/config/ passivelemon/terraria-backup-docker:latest
```### Docker Compose
```yml
version: '3.3'
services:
terraria-backup-docker:
image: passivelemon/terraria-backup-docker:latest
container_name: terraria-backup-docker
volumes:
- :/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
```yml
version: '3.3'
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'
```