vinanrra / Docker-7DaysToDie

7 days to die server using LinuxGSM in Docker with backups, monitor, auto-installable mods and more
GNU General Public License v3.0
210 stars 42 forks source link

[FEATURE] Backup only Save Data #187

Closed crispycream4749 closed 4 weeks ago

crispycream4749 commented 1 year ago

current backup mechanism backups everything including server files. This causes very large zip backups.

I would like if the backups only backed up world and save data.

vinanrra commented 7 months ago

Hi, @crispycream4749, sorry for the late response I'm very busy IRL, I will think about this, because right now I use the LinuxGSM backup command, also this can be achieved relative easy with an external script that stop the docker container and backup the folder, here it's an example:

#!/bin/bash

# Set your Docker container name
DOCKER_CONTAINER_NAME="your_container_name"

# Set the folder to be backed up
BACKUP_FOLDER="/path/to/your/world/folder"

# Set the backup destination
BACKUP_DESTINATION="/path/to/backup/destination"

# Stop the Docker container
echo "Stopping Docker container: $DOCKER_CONTAINER_NAME"
docker stop $DOCKER_CONTAINER_NAME

# Backup the specified folder
echo "Backing up folder: $BACKUP_FOLDER"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
BACKUP_FILE="$BACKUP_DESTINATION/sdtdserver_world_$TIMESTAMP.tar.gz"
tar -czvf $BACKUP_FILE $BACKUP_FOLDER

# Start the Docker container again
echo "Starting Docker container: $DOCKER_CONTAINER_NAME"
docker start $DOCKER_CONTAINER_NAME

echo "Backup completed. Backup file: $BACKUP_FILE"

Just create a file with the above code and add an execution to your crontab system.

I'm adding support for custom mods from Nexus mod, but later I will add this too.

DISCLAIMER: This script isn't tested.

vinanrra commented 4 weeks ago

This should be fixed with #250

If it needs more discussion #249