Jump to content

Server Backup Help


LeoCash

Recommended Posts

This was a minecraft backup script posted in another forums section.

How would it be possible to use this script to backup TeamFortess servers?

 

 

#!/bin/bash

unalias rm

SVCBR="/home/tcadmin/Monitor/servicebrowser"

START=" -command=start"

STOP=" -command=stop"

SVCID=" -service=${Service_ServiceId}"

BKUPDIR="./backup"

 

# Steps to perform backup

 

# 1. Stop MC Service

eval "$SVCBR $STOP $SVCID"

 

# 2. Compress World

NOW=$(date +"%Y-%m-%d-%H-%M-%S")

WRLDFILE="world_$NOW.tar"

tar cf $WRLDFILE world

gzip $WRLDFILE

FILESIZE=$(stat -c%s "$WRLDFILE.gz")

echo "world zipped = $FILESIZE"

 

# 3. Copy to backup folder

mkdir -p $BKUPDIR

mv $WRLDFILE.gz $BKUPDIR/.

 

# 4. Start MC Service

eval "$SVCBR $START $SVCID"

 

# Now clean up so we only keep the last 5 files

ls -F $BKUPDIR/world_* | head -n -5 | xargs rm

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use