Giter Club home page Giter Club logo

mcmgr's Introduction

mcmgr

A minecraft server template directory with bash scripts to start, backup, restore, and stop it.

Setup

First, install dependencies. See below.

Then, set values in the env.sh file.

Then, run ./status to make sure the backup location and java jar look fine. You should only see the backup doesn't exist warning.

Then, run ./run

To check the status, run ./attach

You will be dropped into the tmux session. Press 'Ctrl-b' then 'd' to detach from the tmux session.

mc_server_id

The unique id for the server. This makes it possible to have multiple servers running at once.

mc_root_backup_dir

A location for minecraft backups. The backup for this specific server will be located in $mc_root_backup_dir/$mc_server_id

mc_server_jar

The minecraft server.jar file. It's recommended to put these in a single folder, and each server can use the same one.

Scripts

All scripts can be started from anywhere. They will locate themselves and cd into the script's directory. They assume their directory is where the minecraft server is.

run

Starts the server.

stop

Stops the server.

start

Starts the server in the current terminal. This is good for testing, but run should be preferred.

attach

Attach to the server if it's running. This is used to gain access to the minecraft terminal.

backup

Create a backup in the specified backup directory.

console

Output the console of the currently running server.

send

Send a single command to the server. This is useful for quick things and for avoiding interacting with the server.

status

Output status for the current server. This is a good check to make sure the env.sh is correct.

Backups

In the config file, you can specify

Dependencies

bkup

bkup is a bash script wrapper for incremental backups. It is a submodule of this repo.

Install via submodule

git submodule update --init

Install via clone

git clone https://github.com/lkwilson/bkup.git bkup

You can also download and unzip manually. Just make sure that backup and restore are located as such: ./bkup/backup and ./bkup/restore.

tar

If you are on mac, then your tar is actually bsdtar. The backup script needs gnu tar.

Install with:

brew install gnu-tar

Add an alias in your ~/.bashrc

alias tar=gtar

Or create a higher priority symlinked tar:

PATH="$HOME/bin:$PATH"
ln -s /usr/local/bin/gtar ~/bin/tar

tmux

mcmgr uses tmux for the persistence of the servers.

apt-get update
apt-get install -y tmux

tips

  • Close tmux: ctrl-b + d
  • Attach to any tmux session: tmux a

Java

First, you need a new enough version of java.

Quick Install

Download a Java 16 tar ball from here: https://jdk.java.net/16/

Add the bin/ directory to your PATH env var.

Detailed Install

Download a Java 16 tar ball from here: https://jdk.java.net/16/

Untar the tar ball somewhere in your home directory:

cd ~
mkdir -p libraries/java
cd libraries/java
tar xf /path/to/openjdk-16.0.1_osx-x64_bin.tar.gz

It should create jdk-16.0.1.jdk/

Find the bin/ dir that contains java.

Add it to your PATH variable. For example:

PATH="$HOME/libraries/java/jdk-16.0.1.jdk/Contents/Home/bin:$PATH"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.