promotional bannermobile promotional banner

ScheduledShutdown

Simply set a time to shutdown/restart daily
<p>a stopwatch</p>

a stopwatch

<p>Originated on MinecraftForums posted by 11011011</p>

Originated on MinecraftForums posted by 11011011

Description

ScheduledShutdown

Purpose

There are a lot of plugins out there that I have seen that try to keep the memory fresh and the lag low. Sadly most use an interval type deal where it can shutdown every 8 hours or so. If you want to have the machine running the server to restart as well, then the added time would throw the interval way off and would end up restarting at peak times.

Description

This plugin solves the problems of anyone who wants a simple lightweight daily shutdown/restart at a specific time every day forever.

The config is super simple, on the first line put 0-23 for the hour to stop, and on the second line put 0-59 for the minute you want it to stop. Done!

Blank config file gets made if it does not exist.

Installation

  • Place JAR in plugins folder
  • Run server or reload (prefer reload as you have to stop again)
  • It will generate folder and config file, open config
  • put hour on first line
  • minute on second
  • save
  • now restart the server

Config

If you want it to stop at midnight you would put

0
0

or 

00
00

Those would be read the same, if you want it to stop at 7:37PM you would put

19

37

Notes: Do not put anything else before the two lines of time, let alone the entire file. The config will be updated in the next release of the plugin. All times are local to the machine running the server.

To Restart

This is accomplished in the startup scripts using infinite loops:

For Windows

Click for ADVANCED WINDOWS SCRIPTS

Put ":start" on the line before what you want repeated, then "goto start" on the line after what you want repeated to make an infinite loop. Example craftbukkit.bat:

@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
:start
"%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar
goto start

For *nix OSes

Put "while true" <new line> "do" on the lines before what you want repeated, and "done" on the line after to make an infinite loop. Example craftbukkit.sh:

#!/bin/sh
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "\$BINDIR"
while true
do
       	java -Xmx1024M -Xms1024M -jar craftbukkit.jar
	echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
	echo "Rebooting in:"
	for i in 5 4 3 2 1
	do
		echo "$i..."
		sleep 1
	done
	echo "Rebooting now!"
done

Ending Loop

On Windows, to exit this infinite loop (i.e., take the server down for good), simply close the command window. On Linux, stop the server then press "Ctrl+C" to cancel the process.

Need Help? Video Tutorial

Tutorial provided with thanks by randycougar

Notes

This plugin is super lightweight and simple, taking up next to no memory or processing power

It broadcasts a notice about the approaching shutdown one minute prior.

Scripting from SimpleRestart's Description

Plans

  • Restart every "x" days - or - restart on mon,wed,fri or every tuesday or whatever you want
  • Set time in-game
  • A reload command

The ScheduledShutdown Team

profile avatar
  • 3
    Projects
  • 20.0K
    Downloads

More from _ForgeUser7497922

  • Shop Ads project image

    Shop Ads

    • 2.5K
    • Bukkit Plugins

    Allows users to purchase advertisements for their shops to be run at regular intervals on a server.

    • 2.5K
    • December 21, 2018
    • Bukkit Plugins
    • +3
  • CookieJoin project image

    CookieJoin

    • 1.6K
    • Bukkit Plugins

    Get a cookie when you join!

    • 1.6K
    • June 29, 2012
    • Bukkit Plugins
    • +1
  • ShopAds2 project image

    ShopAds2

    • 15.3K
    • Bukkit Plugins

    Let players advertise their shops and locations to others

    • 15.3K
    • July 14, 2012
    • Bukkit Plugins
    • +3
  • Shop Ads project image

    Shop Ads

    • 2.5K
    • Bukkit Plugins

    Allows users to purchase advertisements for their shops to be run at regular intervals on a server.

    • 2.5K
    • December 21, 2018
    • Bukkit Plugins
    • +3
  • CookieJoin project image

    CookieJoin

    • 1.6K
    • Bukkit Plugins

    Get a cookie when you join!

    • 1.6K
    • June 29, 2012
    • Bukkit Plugins
    • +1
  • ShopAds2 project image

    ShopAds2

    • 15.3K
    • Bukkit Plugins

    Let players advertise their shops and locations to others

    • 15.3K
    • July 14, 2012
    • Bukkit Plugins
    • +3