LeoCash Posted April 11, 2016 Share Posted April 11, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now