Screen package must be installed.
On CentOs and Red Hat-based distributions:
On Debian based systems such as Ubuntu:
To download the script with wget, run the following (WATCH OUT SCRIPT NEEDS WORK - change the WORLD, MCPATH and BACKUPPATH variables.
Important: If you use the wget method and the first character of every line is an empty space, the script won't work and update-rc.d outputs errors. If so, you have to remove the leading empty spaces from each line. Be careful not to delete anything else than empty space though!)
python (apt-get install python)
Use your favorite editor to create file called minecraft in /etc/init.d/ and paste the script above in that file.
Edit the USERNAME and MCPATH -variables according to your setup. If you use a wrapper script, change INVOCATION to start it instead of starting the server directly.
Make sure the newly created file has required permissions You can set the permissions by running:
Then run (on Debian-based distributions)
Starting with Debian 6.0, the insserv command is used instead, if dependency-based booting is enabled. insserv will produce no output if everything went OK. Examine the error code in $? if you want to be sure.
On CentOs and RHEL(Redhat enterprise Linux) You will need to add the process into the chkconfig list chkconfig manages startup scripts under systemd
To check if the process is done correctly use the ntsysv command keep scrolling until you see the minecraft process if you don't repeat the chkconfig command. to add required symbolic links. Note: your system will most likely warn you that the script does not meet all requirements. The script will however work.
You can also setup an entry in your crontab to backup the server. A sample crontab to backup every half hour on the hour, and 30 minutes into the hour:
Using the user account you want the work done under, run:
and add this
If the above attempt went poorly because you do not know how to use vi, try:
(In debian based GNU/Linux distribution)
The script may be invoked via the following command on most systems, where "(command)" will be "stop", "start", "restart", or any of the other options it supports.
On most RedHat- or Debian-based distribution where the `service` command is available, it should be invoked as:
To view the screen, use:
To exit the screen, use: