How to setup a trick'd out CraftBukkit server (1.3.1-R2.0)

Post Reply
User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

How to setup a trick'd out CraftBukkit server (1.3.1-R2.0)

Post: # 327Post LHammonds »

This tutorial will describe how to setup a tricked-out CraftBukkit server.

It will initially be created on a Windows 7 PC and then moved to an Ubuntu Server where it will remain as a production server running almost completely automated.

To discuss this thread, please participate here: Minecraft Forums

Goals:
  • Done - Install and configure a local CraftBukkit server on Windows
  • Done - Install, configure and test plugins
  • Done - Move CraftBukkit to an Ubuntu Server (Linux)
  • Done - Setup server maintenance scripts
Donations

If you have the means and will to donate, please support Mojang 1st by buying a copy of Minecraft if you have not done so already, then to the authors of your favorite plugins. If by then you still want to send some my way, I would be grateful. Here is my link: PayPal for LHammonds

Prerequisites
  • Minecraft 1.3.1 ($30 USD)
  • Ubuntu Server 12.04.1 LTS, 64-bit (free)
  • Java version 1.7u7 (free)
    • Java 7 for Linux x64 = jre-7u7-linux-x64.bin
    • Java 7 for Windows x86 = jre-7u7-windows-i586.exe
    • Java 7 for Windows x64 = jre-7u7-windows-x64.exe
  • CraftBukkit 1.3.1-R2.0 (free)
  • CraftBukkit plugins (free)
For CraftBukkit servers, I like to select plugins that do not have any client-side requirements. Simply install on the server and everyone immediately enjoys the new content added to the server.

I will describe how to 1st setup the server on Windows and then transfer it to Ubuntu, however, all of this can be done starting with Ubuntu but I find it easier starting off with a pre-built installation (since my desktop is Windows)

Also note that whenever I say "download the latest version" of a plugin, I am talking about the latest one for the specific CraftBukkit (CB) version you are using. If you are using CB 1.3.1, be sure to only get the plugin version that was made for CB 1.3.1. Newer versions of plugins might work but they also might not. Same goes for the other way around. If a plugin was made for an earlier version of CB, it may or may not work with the newer version of CB. But no matter what, always check the server.log for errors and make sure the plugin works in the game before claiming success and trying to install another. Several plugins in this tutorial were made for much older versions of CraftBukkit but through testing, have been verified to still work with newer versions.

Install a local CraftBukkit server on Windows

These steps were documented on a Windows 7, 64-bit PC with Java 7 Update 7 (both 64-bit and 32-bit versions)

1. Download the latest recommended build (version) of CraftBukkit (1.3.1-R2.0 at the time of this writing)
2. Make a folder on your computer. Example: E:\CraftBukkit
3. Copy the CraftBukkit jar file into this folder. Example: E:\CraftBukkit\craftbukkit-1.3.1-R2.0.jar
4. Rename the jar file to "craftbukkit.jar" to keep things simple.
5. Create a text file called E:\CraftBukkit\startcb.txt and copy the following text into it:
Spoiler:

Code: Select all

@ECHO OFF
SET RAM2USE=2048
CD /D E:\CraftBukkit

REM ** Look for a version of Java 7 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
IF EXIST "%ProgramFiles%\Java\jre7\bin\java.exe" GOTO JAVA7DEFAULT

REM ** Look for 32-bit version of Java 7 on 64-bit OS **
IF EXIST "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" GOTO JAVA732BIT

REM ** Look for a version of Java 6 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
IF EXIST "%ProgramFiles%\Java\jre6\bin\java.exe" GOTO JAVA6DEFAULT

REM ** Look for 32-bit version of Java 6 on 64-bit OS **
IF EXIST "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" GOTO JAVA632BIT

:JAVA7DEFAULT
REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 7 **
REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 7 **
"%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
GOTO DONE

:JAVA732BIT
REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 7 **
"%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
GOTO DONE

:JAVA6DEFAULT
REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 6 **
REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 6 **
"%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
GOTO DONE

:JAVA632BIT
REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 6 **
"%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
GOTO DONE

:DONE
REM ** This will pause the screen so you can see any error messages after stopping the CraftBukkit server. **
PAUSE
NOTE #1: You might need to adjust the amount of memory used on the 2nd line (1024 = 1 GB RAM minimum).
NOTE #2: You might need to adjust the server folder on the 3rd line to reflect your system. For this example, I have it installed on drive E:
NOTE #3: This batch script will choose the newer Java installed as well as picking the 64-bit version if present.

6. Save and close the text file. Rename the file to "startcb.bat" (you might need to disable hidden filename extensions to make this work)
7. Double-click "startcb.bat" and if things go well, CraftBukkit will start in black DOS window and go through the initial startup and generate the initial files and sub-folders. Depending on your security, you may need to give permission to let the processes run (e.g. Comodo will ask about 4 questions before letting it run)
8. Once the server has finished loading, type "stop" at the server console to gracefully stop CraftBukkit. Get used to what it normally says when shutting down properly...it can be handy to know. Then press any key to close the window (this is that "pause" command at the end of the script)

Configure the CraftBukkit Server

At this point, we now have a default CraftBukkit server. Let's configure some of the basic settings. (Make sure the server is not running)

Use a text editor to edit Server.Properties

Notice the following line:

Code: Select all

server-port=25565
This is the default port the server will use to communicate to Minecraft clients. Make sure your firewall will allow traffic on this port.

If you change this port to anything else, your Minecraft clients will need to add the port as part of the server IP when defining your server. Example: If you change it to 25500 and your IP is 192.168.1.100, your other PCs will need to add 192.168.1.100:25500 as the server address.

If you plan to host this server on a private network which does not have or want Internet access, you need to change the following line from true to false:

Code: Select all

online-mode=true
The above is great for LAN parties and homes where young kids can play on local servers without being exposed to the big bad Internet...however, if you plan to run a public Internet server, it is a bad idea to by-pass the login authentication for many reasons.

If you know how many people will be connecting to the server, be sure to set that amount on the following line (typically, it is a good idea to set it one higher than your expected maximum)

Code: Select all

max-players=20
It is also a good idea to set a good description for your server by using the following line:

Code: Select all

motd=A Minecraft Server
I have mine set to the following:

Code: Select all

motd=CraftBukkit 1.3.1 R2.0 Build 2340
Save and close Server.Properties

Double-Click startcb.bat to start the CraftBukkit server with your new settings.

Once it loads up, give yourself admin rights on the server by typing op YourMinecraftName at the server console. This adds your name to the following file: E:\CraftBukkit\ops.txt

Start your Minecraft client and click Multiplayer from the main screen. Click the "Add server" button. Give the server a name and type in the IP address of the server (if on your PC, simply use "localhost" or something like "localhost:25500" if using a custom port number and then click Done.

If the client sees the server, you should see your server with your custom description (e.g. CraftBukkit 1.3.1 R2.0 Build 2340) as well as the amount of currently logged in players and maximum amount of players (e.g. 0/20).

If you get connected, see if you can survive the 1st night. :D Disconnect when you are satisfied that it works good enough.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 328Post LHammonds »

Add a plugin: TreeAssist
Spoiler:
1. Download the latest version (4.5 at the time of this document).
2. Copy "TreeAssist.jar" to E:\CraftBukkit\Plugins\TreeAssist.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\TreeAssist\config.yml
6. The default settings are typically OK but if you want to change something such as setting Jungle trees so they are not affected by this plugin, change "Jungle: true" to "Jungle: false"
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 13:17:58 [INFO] [TreeAssist] Loading TreeAssist v4.4
2012-09-09 13:17:59 [INFO] [TreeAssist] Enabling TreeAssist v4.4
9. Start your Minecraft client, connect to your multiplayer server and use an axe to chop the bottom log of a tree. You should see all the logs fall down. Sweet!
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

Add a plugin: Essentials
Spoiler:
1. Download the latest version (2.9.3 at the time of this document).
2. Extract Essentials.zip to E:\CraftBukkit\Plugins\ which will create the following files:

Essentials.jar
EssentialsChat.jar
EssentialsProtect.jar
EssentialsSpawn.jar

3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\Essentials\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 13:48:33 [INFO] [Essentials] Loading Essentials v2.9.3
2012-09-09 13:48:33 [INFO] [EssentialsChat] Loading EssentialsChat v2.9.3
2012-09-09 13:48:33 [INFO] [EssentialsProtect] Loading EssentialsProtect v2.9.3
2012-09-09 13:48:33 [INFO] [EssentialsSpawn] Loading EssentialsSpawn v2.9.3
2012-09-09 13:48:34 [INFO] [Essentials] Enabling Essentials v2.9.3
2012-09-09 13:48:34 [INFO] Essentials: Using config based permissions. Enable superperms in config.
2012-09-09 13:48:34 [INFO] [EssentialsChat] Enabling EssentialsChat v2.9.3
2012-09-09 13:48:34 [INFO] [EssentialsProtect] Enabling EssentialsProtect v2.9.3
2012-09-09 13:48:34 [INFO] [EssentialsSpawn] Enabling EssentialsSpawn v2.9.3
9. Start your Minecraft client, connect to your multiplayer server. Hold a used tool in your hand (has some damage on it) and press "t" to open the chat bar. Type "/repair hand" and your tool's health should return to perfect condition.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

Add a plugin: Seattle Summer
Spoiler:
1. Download the latest version (2.0 at the time of this document).
2. Copy "SeattleSummer.jar" to E:\CraftBukkit\Plugins\SeattleSummer.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\SeattleSummer\config.yml
6. The default settings are typically OK.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 13:53:36 [INFO] [SeattleSummer] Loading SeattleSummer v2.0.0
2012-09-09 13:53:37 [INFO] [SeattleSummer] Enabling SeattleSummer v2.0.0
2012-09-09 13:53:37 [INFO] [SeattleSummer] v2.0.0 by Quaz3l and Fritz: Enabled
9. Start your Minecraft client, connect to your multiplayer server and make sure the weather does not last longer that what was mentioned in the config file (e.g.300 ticks)
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

Add a plugin: SuperCauldrons
Spoiler:
1. Download the latest version (1.2.2 at the time of this document).
2. Copy "SuperCauldrons.jar" to E:\CraftBukkit\Plugins\SuperCauldrons.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configuration file. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\SuperCauldrons\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 14:29:41 [INFO] [SuperCauldrons] Loading SuperCauldrons v1.2.2
2012-09-09 14:29:42 [INFO] [SuperCauldrons] Enabling SuperCauldrons v1.2.2
2012-09-09 14:29:42 [INFO] [SuperCauldrons] Version 1.2.2 by Zach Hinchy (http://hinchy.us/) has been enabled.
9. Start your Minecraft client, connect to your multiplayer server. Craft a cauldron using iron ingots. Place the cauldron down somewhere. Take a bucket of water and fill up the cauldron. Now that your bucket is empty, fill it from the cauldron. Both your cauldron and bucket should now contain water!
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

Add a plugin: GravelClay
Spoiler:
1. Download the latest version (1.3.5-Update at the time of this document).
2. Copy "GravelClay.jar" to E:\CraftBukkit\Plugins\GravelClay.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\GravelClay\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 14:33:18 [INFO] [GravelClay] Loading GravelClay v1.3.5
2012-09-09 14:33:20 [INFO] [GravelClay] Enabling GravelClay v1.3.5
2012-09-09 14:33:20 [INFO] [GravelClay] version 1.3.5 by [Darklust] is enabled.
9. Start your Minecraft client, connect to your multiplayer server. Pore some water over a gravel block and watch it turn into clay.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

Add a plugin: UnCraftables
Spoiler:
1. Download the latest version (0.0.2 at the time of this document).
2. Extract the zip file to E:\CraftBukkit\Plugins\
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 14:56:15 [INFO] [UnCraftables] Enabling UnCraftables v0.0.1
2012-09-09 14:56:15 [INFO] [UnCraftables] Uncraftables has been Enabled!
4. Start your Minecraft client, connect to your multiplayer server. Place a dirt block and a seed on top of it to make a grass block.
5. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins - bPermissions

Post: # 329Post LHammonds »

Now that we have done a few basic and easy-to-install and easy-to-use plugins, lets install some more complicated and involved plugins that will play a major part in most everything that installed. First will be a permission plugin. There are several of these out there but one seems to stand out from the rest and is enjoying continued development. I chose bPermissions for my servers but you could select one of the others out there such as PermissionsEX or BukkitPermissions.

Add a plugin: bPermissions

NOTE: Before saving any .yml file, be sure to copy and paste it into a YAML parser to validate correct formatting. You must use the correct number of spaces for indentation and cannot use tab characters.
Spoiler:
1. Download the latest version (2.9.20b at the time of this document).
2. Copy "bpermissions.jar" to E:\CraftBukkit\Plugins\bpermissions.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configuration files. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. If you have "online-mode=false" in Server.Properties, you will need to change "allow-offline-mode" from false to true.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 16:13:35 [INFO] [bPermissions] Loading bPermissions v2.9.18
2012-09-09 16:13:36 [INFO] [bPermissions] Enabling bPermissions v2.9.18
2012-09-09 16:13:36 [INFO] [bPermissions] Loading world: world
2012-09-09 16:13:36 [INFO] [bPermissions] Loading world: world_nether
2012-09-09 16:13:36 [INFO] [bPermissions] Loading world: world_the_end
9. Start your Minecraft client, connect to your multiplayer server with your admin/op ID. Type "t" to start a chat and type "/permissions helpme" and you should see a message saying "[bPermissions] Creating example files!"
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
11. You should now have a world, world_nether, world_the_end sub-folders under the bPermissions folder. You should also have a couple of files in each folder and 5 files in the root of the bPermissions folder.
- Plugins\bPermissions\config.yml - This holds general settings for the bPermissions plugin itself.
- Plugins\bPermissions\custom_nodes.yml - Allows you to bPermission formatting instead of true/false settings.
- Plugins\bPermissions\groups.yml - This is just a template for the group files that get copied to new world sub-folders. At this point, it should contain all known permissions for the bukkit server and installed plugins because of that nice "/permissions helpme" command you issued earlier. We will arrange these settings later.
- Plugins\bPermissions\mirrors.yml - This little jewel allows you mirror your settings in one world to other worlds...allowing you to configure in one place and make use of those permissions in other worlds automatically.
- Plugins\bPermissions\tracks.yml - This allows you to define which groups people can get promoted to or demoted from. It can help with user rights progression.
- Plugins\bPermissions\users.yml - This is just a template for the user files that get copied to new world sub-folders. It should also contain some example users because of the "/permissions helpme" command.
12. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\mirrors.yml
- You should see the following two example lines:

Code: Select all

example_world_nether: example_world
example_world_end: example_world
- Change them to look like the following:

Code: Select all

world_nether: world
world_the_end: world
- This allows us to configure the "world" files and have the permissions in them mirrored to the other two worlds. So we only need to configure the "world" files for now.
13. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\groups.yml (remember, this is just a template)
- There are 3 groups configured in here: admin, default, moderator
- The group a new user will be assigned to is the default group which is appropriately named "default"

Here is what it looks like:

Code: Select all

default: default
groups:
  admin:
    permissions:
    - bPermissions.*
    - bukkit.broadcast
    - bukkit.broadcast.admin
    - bukkit.command
    - bukkit.command.defaultgamemode
    - bukkit.command.gamemode
    - bukkit.command.give
    - bukkit.command.help
    - bukkit.command.kill
    - bukkit.command.list
    - bukkit.command.me
    - bukkit.command.op
    - bukkit.command.op.give
    - bukkit.command.op.take
    - bukkit.command.plugins
    - bukkit.command.reload
    - bukkit.command.save
    - bukkit.command.save.disable
    - bukkit.command.save.enable
    - bukkit.command.save.perform
    - bukkit.command.say
    - bukkit.command.seed
    - bukkit.command.stop
    - bukkit.command.teleport
    - bukkit.command.tell
    - bukkit.command.time
    - bukkit.command.time.add
    - bukkit.command.time.set
    - bukkit.command.toggledownfall
    - bukkit.command.unban
    - bukkit.command.unban.ip
    - bukkit.command.unban.player
    - bukkit.command.version
    - bukkit.command.whitelist
    - bukkit.command.whitelist.add
    - bukkit.command.whitelist.disable
    - bukkit.command.whitelist.enable
    - bukkit.command.whitelist.list
    - bukkit.command.whitelist.reload
    - bukkit.command.whitelist.remove
    - bukkit.command.xp
    - craftbukkit
    - group.admin
    - tracks.*
    - ^group.moderator
    groups:
    - moderator
    meta:
      prefix: '&5admin'
  default:
    permissions:
    - bukkit.broadcast.user
    - group.default
    groups: []
    meta:
      prefix: '&9user'
  moderator:
    permissions:
    - bukkit.command.ban
    - bukkit.command.ban.ip
    - bukkit.command.ban.player
    - bukkit.command.kick
    - group.moderator
    - ^group.default
    groups:
    - default
    meta:
      prefix: '&7moderator'
Below is what I would change this to for now. I have included a "builder" group that normal members will be assigned.

Code: Select all

default: default
groups:
  admin:
    permissions:
    - bPermissions.*
    - bukkit.broadcast.admin
    - bukkit.command
    - bukkit.command.defaultgamemode
    - bukkit.command.gamemode
    - bukkit.command.give
    - bukkit.command.kill
    - bukkit.command.list
    - bukkit.command.me
    - bukkit.command.op
    - bukkit.command.op.give
    - bukkit.command.op.take
    - bukkit.command.plugins
    - bukkit.command.reload
    - bukkit.command.save
    - bukkit.command.save.disable
    - bukkit.command.save.enable
    - bukkit.command.save.perform
    - bukkit.command.say
    - bukkit.command.seed
    - bukkit.command.stop
    - bukkit.command.teleport
    - bukkit.command.tell
    - bukkit.command.time
    - bukkit.command.time.add
    - bukkit.command.time.set
    - bukkit.command.toggledownfall
    - bukkit.command.whitelist
    - bukkit.command.whitelist.add
    - bukkit.command.whitelist.disable
    - bukkit.command.whitelist.enable
    - bukkit.command.whitelist.list
    - bukkit.command.whitelist.reload
    - bukkit.command.whitelist.remove
    - bukkit.command.xp
    - craftbukkit
    - group.admin
    - group.moderator
    - tracks.*
    groups:
    - moderator
    - default
    meta:
      prefix: '&5[admin]'
      priority: '100'
  builder:
    permissions:
    - bukkit.command.help
    - bukkit.command.list
    groups: default
    meta:
      prefix: '&9[builder]'
      priority: '20'
  default:
    permissions:
    - bukkit.broadcast.user
    - bukkit.command.version
    - bukkit.command.help
    groups: []
    meta:
      prefix: '&9[newbie]'
      priority: '10'
  moderator:
    permissions:
    - bukkit.command.ban
    - bukkit.command.ban.ip
    - bukkit.command.ban.player
    - bukkit.command.kick
    - bukkit.command.unban
    - bukkit.command.unban.ip
    - bukkit.command.unban.player
    - group.default
    groups:
    - default
    meta:
      prefix: '&7[moderator]'
      priority: '50'
- Save and close the file

14. Copy and replace bPermissions\groups.yml to bPermissions\world\groups.yml
15. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\users.yml (remember, this is just a template)

Here is what it looks like:

Code: Select all

users:
  codename_b:
    permissions: []
    groups:
    - admin
    meta:
      prefix: '&8developer'
  notch:
    permissions: []
    groups:
    - moderator
    meta:
      prefix: '&8mojang'
  pyraetos:
    permissions: []
    groups:
    - default
    meta:
      prefix: '&3helper'
I modified it to include my users as noted below. Notice how everything is controlled through the groups...no specific/unique settings for any one person.

Code: Select all

users:
  lhammonds:
    permissions: []
    groups:
    - admin
  jhammonds:
    permissions: []
    groups:
    - moderator
  derpboy:
    permissions: []
    groups:
    - builder
- Save and close the file
16. Copy and replace bPermissions\users.yml to bPermissions\world\users.yml
17. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 16:39:10 [INFO] [bPermissions] Loading bPermissions v2.9.18
2012-09-09 16:39:11 [INFO] [bPermissions] Enabling bPermissions v2.9.18
2012-09-09 16:39:11 [INFO] [bPermissions] Loading world: world
18. Start your Minecraft client, connect to your multiplayer server as an admin, then as a moderator, then as a builder and then as a default user and see if you are able to do the things your group is allowed and try to do things your group is not allowed to make sure permissions are working correctly.
19. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 330Post LHammonds »

Add a plugin: Flight
Spoiler:
1. Download the latest version (1.3 at the time of this document).
2. Copy "Flight.jar" to E:\CraftBukkit\Plugins\Flight.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 16:42:41 [INFO] [Flight] Enabling Flight v1.3
4. Start your Minecraft client, connect to your multiplayer server and type "t" to enter chat mode, then type "/flight on" and press SPACEBAR twice to see if you can fly.
5. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure Permissions for Flight
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - flight.check.other
    - flight.off.other
    - flight.on.other
    - flight.toggle.other
  builder:
    permissions:
    - flight.check
    - flight.help
    - flight.list
    - flight.off
    - flight.on
    - flight.toggle
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: BookShelf
Spoiler:
1. Download the latest version (1.2 at the time of this document).
2. Copy "BookShelf.jar" to E:\CraftBukkit\Plugins\BookShelf.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 14:51:33 [INFO] [BookShelf] Loading BookShelf v1.2
2012-09-09 14:51:34 [INFO] [BookShelf] Enabling BookShelf v1.2
2012-09-09 14:51:34 [INFO] BookShelf Database Loaded.
2012-09-09 14:51:34 [INFO] BookShelf version 1.2 is enabled.
Configure Permissions for BookShelf
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - bookshelf.bs
  default:
    permissions:
    - bookshelf.baq
    - bookshelf.book
    - bookshelf.signed
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: BleedingMobs
Spoiler:
1. Download the latest version (3.6d at the time of this document).
2. Extract the zip file to E:\CraftBukkit\Plugins\
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 15:30:56 [INFO] [BleedingMobs] Loading BleedingMobs v3.6d
2012-09-09 15:30:57 [INFO] [BleedingMobs] Enabling BleedingMobs v3.6d
4. Start your Minecraft client, connect to your multiplayer server. Whip out your sword and lay down some rightous smackdown on a mob and watch it bleed (or watch yourself bleed after taking some damage).
5. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure Permissions for BleedingMobs
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - bleedingmobs.admin
  default:
    permissions:
    - bleedingmobs.bloodstrike
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: EpicGlass
Spoiler:
1. Download the latest version (1.15 at the time of this document).
2. Copy "EpicGlass.jar" to E:\CraftBukkit\Plugins\EpicGlass.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 17:27:57 [INFO] [EpicGlass] Enabling EpicGlass v1.15 by Malikk
2012-09-09 17:27:57 [INFO] [EpicGlass] Guns+ was not found.
2012-09-09 17:27:57 [INFO] [EpicGlass] Shield was not found.
2012-09-09 17:27:57 [INFO] [EpicGlass] Enabled
4. Start your Minecraft client, connect to your multiplayer server. Run through some glass and watch it break. Wait a couple minutes and watch it grow back.
5. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure Permissions for EpicGlass
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - epicglass.cmd.regen
    - epicglass.cmd.reload
    - epicglass.cmd.setflag
  default:
    permissions:
    - epicglass.break.arrow
    - epicglass.break.fall
    - epicglass.break.guns
    - epicglass.break.sprint
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Fortification
Spoiler:
1. Download the latest version (0.9 at the time of this document).
2. Copy "Fortification.jar" to E:\CraftBukkit\Plugins\Fortification.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 21:24:39 [INFO] [Fortification] Loading Fortification v0.9
2012-09-09 21:24:41 [INFO] [Fortification] Enabling Fortification v0.9
2012-09-09 21:24:41 [INFO] [Fortification]: Factions plugin not detected, faction filters will be disabled.
2012-09-09 21:24:41 [INFO] [Fortification]: Towny plugin not detected, towny filters will be disabled.
2012-09-09 21:24:41 [INFO] fortification 0.9 initialized
4. Stop the server and edit E:\CraftBukkit\Plugins\Fortification\config.yml and copy/paste this into the file:

Code: Select all

sensor-range: 5
trap-door-range: 5
send-sign-search-distance: 5
send-signs-remove-original-text: true
send-overwrites-existing-text: true
allow-command-sends: true
flameturret-block-id: 0
chest-shield-range: 5
send-overwrites-commands: true
teleblock-string: All your base are belong to us
replace-trapdoor-blocks-on-power-off: true
teleblock-shield-range: 5
flameturret-range: 5
teleblock-shield-block-Id: 0
webturret-block-id: 0
webturret-range: 5
web-dissipation-time: 5
arrowturret-block-id: 0
sensor-broadcast-dist: 5
msg-builder-only: false
webturret-cost: 0.0
flameturret-cost: 0.0
sensor-cost: 0.0
chestshield-cost: 0.0
teleblockshield-cost: 0.0
sendsign-cost: 0.0
equalsign-cost: 0.0
trapdoor-cost: 0.0
arrowturret-cost: 0.0
4. Start the server, then start your Minecraft client, connect to your multiplayer server. Place a dirt block, put a sign on it for a fire turret, set a lever on top and pull the trigger to set fire to some blocks.
5. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure Permissions for Fortification
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  builder:
    permissions:
    - fortification.equalsign
    - fortification.msgsign
    - fortification.sendsign
    - fortification.sensor
    - fortification.shield.chest
    - fortification.shield.teleblock
    - fortification.trapdoor
    - fortification.turret.arrow
    - fortification.turret.flame
    - fortification.turret.web
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 331Post LHammonds »

Add a plugin: MobHealth
Spoiler:
1. Download the latest version (4.9.1 at the time of this document).
2. Copy "MobHealth.jar" to E:\CraftBukkit\Plugins\MobHealth.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 22:34:56 [INFO] [MobHealth] Loading MobHealth v4.9.1
2012-09-09 22:34:59 [INFO] [MobHealth] Enabling MobHealth v4.9.1
2012-09-09 22:34:59 [INFO] [MobHealth] Permissions Disabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Spout Enabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Player Notifications Enabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Monster Notifications Enabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Animals Notifications Enabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Pet Notifications Enabled.
2012-09-09 22:34:59 [INFO] [MobHealth] Online.
4. Stop the server and edit E:\CraftBukkit\Plugins\MobHealth\config.yml, change the following and save/exit:

Code: Select all

usePermissions: false
to

Code: Select all

usePermissions: true
5. Start your Minecraft client, connect to your multiplayer server. Attack a mod and see if the damage/health amount is displayed as a chat message.
6. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure Permissions for MobHealth
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - MobHealth.command.reload
  default:
    permissions:
    - MobHealth.show
    - MobHealth.command.toggle
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: FoundDiamonds
NOTE: If you add a new world, be sure to update this plugins config.yml to enable it.
Spoiler:
1. Download the latest version (3.5.4 at the time of this document).
2. Copy "FoundDiamonds.jar" to E:\CraftBukkit\Plugins\FoundDiamonds.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\FoundDiamonds\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. NOTE: As you add worlds, you need to add them to this file under the "Enabled Worlds" section.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 23:00:13 [INFO] [FoundDiamonds] Loading FoundDiamonds v3.5.4
2012-09-09 23:00:14 [INFO] [FoundDiamonds] Enabling FoundDiamonds v3.5.4
2012-09-09 23:00:15 [INFO] [FoundDiamonds] [FoundDiamonds] Enabled
9. Start your Minecraft client, connect to your multiplayer server. Mine some ore such as coal, iron, gold, redstone or diamond and notice the initial broadcast when you break the 1st ore block.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for FoundDiamonds
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - fd.*
  default:
    permissions:
    - fd.trap
    - fd.world
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: KonseptGate
Spoiler:
1. Download the latest version (0.5.3 at the time of this document).
2. Copy "KonseptGate.jar" to E:\CraftBukkit\Plugins\KonseptGate.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\KonseptGate\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 23:10:27 [INFO] [KonseptGate] Loading KonseptGate v0.5.3
2012-09-09 23:10:29 [INFO] [KonseptGate] Enabling KonseptGate v0.5.3
2012-09-09 23:10:29 [INFO] [KonseptGate 0.5.3] Enabled (0 gates)
9. Start your Minecraft client, connect to your multiplayer server. Type "t" to start a chat, then type "kg /create home" and see if a gate is placed below your feet.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Konsept Gate
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - konseptgate.command.create
    - konseptgate.command.delete
    - konseptgate.command.move
    - konseptgate.command.link
    - konseptgate.command.reload
    - konseptgate.command.jump
    - konseptgate.command.ignore
  default:
    permissions:
    - konseptgate.command.list
    - konseptgate.teleport
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: mcMMO
Spoiler:
1. Download the latest version (1.3.11 at the time of this document).
2. Copy "mcMMO.jar" to E:\CraftBukkit\Plugins\mcMMO.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\mcMMO\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 23:20:48 [INFO] [mcMMO] Loading mcMMO v1.3.11-b1030
2012-09-09 23:20:48 [INFO] [mcMMO] Enabling mcMMO v1.3.11-b1030
2012-09-09 23:20:48 [INFO] [mcMMO] Loading mcMMO config.yml File...
2012-09-09 23:20:48 [INFO] [mcMMO] Loading mcMMO treasures.yml File...
2012-09-09 23:20:48 [INFO] [mcMMO] Loading mcMMO repair.vanilla.yml File...
2012-09-09 23:20:48 [INFO] mcMMO version 1.3.11-b1030 is enabled!
9. Start your Minecraft client, connect to your multiplayer server. Mine some ore such as coal, iron, gold, redstone or diamond and notice the initial broadcast when you break the 1st ore block.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for mcMMO
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - mcmmo.admin
    - mcmmo.bypass.arcanebypass
    - mcmmo.chat.adminchat
    - mcmmo.commands.ability
    - mcmmo.commands.inspect
    - mcmmo.defaultsop
    - mcmmo.tools.*
  default:
    permissions:
    - mcmmo.ability.*
    - mcmmo.chat.partychat
    - mcmmo.commands.party
    - mcmmo.commands.ptp
    - mcmmo.defaults
    - mcmmo.item.*
    - mcmmo.motd
    - mcmmo.skills.*
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: SilkSpawners
Spoiler:
1. Download the latest version (2.0.2 at the time of this document).
2. Copy "SilkSpawners.jar" to E:\CraftBukkit\Plugins\SilkSpawners.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\SilkSpawners\config.yml
6. The default settings are typically OK but since we are using a permission plugin, change the following line:

Code: Select all

usePermissions: false
to

Code: Select all

usePermissions: true
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 23:31:04 [INFO] [SilkSpawners] Loading SilkSpawners v2.0.2
2012-09-09 23:31:05 [INFO] [SilkSpawners] Enabling SilkSpawners v2.0.2
2012-09-09 23:31:05 [INFO] SilkSpawners enabled
9. Start your Minecraft client, connect to your multiplayer server. Use a pickaxe with the Silk Touch enchantment and destroy a monster spawner...which should drop the spawner on the ground for you to pick up.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for SilkSpawners
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - silkspawners.changetype
    - silkspawners.changetypewithegg
    - silkspawners.freeitem
    - silkspawners.freeitemegg
  default:
    permissions:
    - silkspawners.info
    - silkspawners.silkdrop
    - silkspawners.viewtype
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 332Post LHammonds »

Add a plugin: Appleseed
Spoiler:
1. Download the latest version (0.7.2 at the time of this document).
2. Copy "Appleseed.jar" to E:\CraftBukkit\Plugins\Appleseed.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\Appleseed\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 19:47:37 [INFO] [Appleseed] Loading Appleseed v0.7.2
2012-09-10 19:47:39 [INFO] [Appleseed] Enabling Appleseed v0.7.2
2012-09-10 19:47:39 [INFO] Appleseed: ShowErrorsInClient=true
2012-09-10 19:47:39 [INFO] Appleseed: DropInterval=60 seconds
2012-09-10 19:47:39 [INFO] Appleseed: MaxUncollectedItems=6
2012-09-10 19:47:39 [INFO] Appleseed: WandItem=wood_hoe
2012-09-10 19:47:39 [INFO] Appleseed: FertilizerItem=bone_meal
2012-09-10 19:47:39 [INFO] Appleseed: MinimumTreeDistance=disabled
2012-09-10 19:47:39 [INFO] Appleseed: SignTag=Appleseed
2012-09-10 19:47:39 [INFO] Appleseed: TreeTypes=(apple,golden_apple,cocoa_beans,cookie)
2012-09-10 19:47:39 [INFO] Appleseed: 0 trees loaded in world world.
2012-09-10 19:47:39 [INFO] Appleseed: 0 trees loaded in world world_nether.
2012-09-10 19:47:39 [INFO] Appleseed: 0 trees loaded in world world_the_end.
2012-09-10 19:47:39 [INFO] Appleseed version 0.7.2 is enabled!
9. Start your Minecraft client, connect to your multiplayer server. Take an apple and right-click on empty farmland to plant an apple tree. Use bonemeal to quick-grow(tm) it and watch the apples drop!
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Appleseed
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  default:
    permissions:
    - appleseed.plant.*
    - appleseed.wand
    - appleseed.sign.place
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Armor Abilities
Spoiler:
1. Download the latest version (2.1.5 at the time of this document).
2. Copy "ArmorAbilities.jar" to E:\CraftBukkit\Plugins\ArmorAbilities.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\ArmorAbilities\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 21:00:13 [INFO] [ArmorAbilities] Loading ArmorAbilities v2.1.5
2012-09-10 21:00:14 [INFO] [ArmorAbilities] Enabling ArmorAbilities v2.1.5
9. Start your Minecraft client, connect to your multiplayer server. Put on a full set of leather armor and see if you are super-fast!
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Armor Abilities
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  builder:
    permissions:
    - armorabilities.nofalldamage
    - armorabilities.jump
    - armorabilities.nodrown
    - armorabilities.scubahaste
    - armorabilities.haste
    - armorabilities.speed
    - armorabilities.lavaswim
    - armorabilities.nofiredamage
    - armorabilities.rage
    - armorabilities.sneak
    - armorabilities.peace
    - armorabilities.creeper
    - armorabilities.magicfeet
    - armorabilities.setown
    - armorabilities.vampire
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Useful Snow
Spoiler:
1. Download the latest version (1.2 at the time of this document).
2. Copy "UsefulSnow.jar" to E:\CraftBukkit\Plugins\UsefulSnow.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\UsefulSnow\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-12 21:20:13 [INFO] [UsefulSnow] Loading UsefulSnow v1.2
2012-09-12 21:20:15 [INFO] [UsefulSnow] Enabling UsefulSnow v1.2
9. Start your Minecraft client, connect to your multiplayer server. Pick up some snow with your bare hands. Throw the snow back on the ground.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Useful Snow
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  default:
    permissions:
    - usefulsnow.damage
    - usefulsnow.fire
    - usefulsnow.ice
    - usefulsnow.pickup
    - usefulsnow.slowness
    - usefulsnow.snow
    - usefulsnow.stacksnow
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: BloodMoon
NOTE: If you add a new world, be sure to update this plugins config.yml to enable it.
Spoiler:
1. Download the latest version (0.16 at the time of this document).
2. Copy "BloodMoon.jar" to E:\CraftBukkit\Plugins\BloodMoon.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\BloodMoon\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. NOTE: As you add worlds, you need to add them to this file under the "affected-worlds" section.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 21:53:44 [INFO] [BloodMoon] Loading BloodMoon v0.16
2012-09-10 21:53:44 [INFO] [BloodMoon] Enabling BloodMoon v0.16
9. Start your Minecraft client, connect to your multiplayer server. At sunset, type "/bloodmoon start" and it should reply "The blood moon is rising" and you will then enjoy an adventurous night!
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for BloodMoon
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - bloodmoon.admin.start
    - bloodmoon.admin.stop
    - bloodmoon.admin.ignore-world-lock
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: RealWeather
Spoiler:
1. Download the latest version (1.2.1 at the time of this document).
2. Copy "RealWeather.jar" to E:\CraftBukkit\Plugins\RealWeather.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\RealWeather\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. NOTE: As you add worlds, you need to add them to this file under the "AffectedWorlds" section.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 16:38:19 [INFO] [RealWeather] Loading RealWeather v1.2.1
2012-09-11 16:38:20 [INFO] [RealWeather] Enabling RealWeather v1.2.1
2012-09-11 16:38:20 [INFO] [RealWeather] Default config.yml copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Loading Configuration.
2012-09-11 16:38:20 [INFO] [RealWeather] Winter configuration file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Desert configuration file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Jungle configuration file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Global configuration file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Armour configuration file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Localization file copied.
2012-09-11 16:38:20 [INFO] [RealWeather] Language: English
2012-09-11 16:38:20 [INFO] [RealWeather] RealWeather enabled.
9. Start your Minecraft client, connect to your multiplayer server. Stand out in the freezing snow without armor and see how painful it is.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for RealWeather
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - realwinter.admin
  default:
    permissions:
    - realwinter.player
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 333Post LHammonds »

Add a plugin: Catacombs
[sp]1. Download the latest version (2.6 at the time of this document).
2. Copy "Catacombs.jar" to E:\CraftBukkit\Plugins\Catacombs.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\Catacombs\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 22:12:56 [INFO] [Catacombs] Loading Catacombs v2.6
2012-09-10 22:12:58 [INFO] [Catacombs] Enabling Catacombs v2.6
2012-09-10 22:12:58 [INFO] [Catacombs] Found permission system 'bPermissions2'
2012-09-10 22:12:58 [INFO] [Catacombs] Found economy system 'Essentials Economy'
9. Start your Minecraft client, connect to your multiplayer server. Stand in a clear field. Type "T" for chat and type "/cat plan maze-of-doom 10 20" and if that seemed to work ok, then type "/cat build maze-of-doom" and enjoy your dungeon-of-awesome.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.[/sp]

Configure permissions for Catacombs
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - catacombs.admin
    - catacombs.plan
    - catacombs.build
    - catacombs.scatter
    - catacombs.delete
    - catacombs.reset
    - catacombs.unprot
    - catacombs.goto
    - catacombs.end
    - catacombs.which
    - catacombs.suspend
    - catacombs.enable
    - catacombs.style
    - catacombs.list
  builder:
    permissions:
    - catacombs.gold
    - catacombs.recall
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: ChestShop
Spoiler:
1. Download the latest version (3.46 at the time of this document).
2. Rename "ChestShop3-46.jar" to "ChestShop.jar" and copy to E:\CraftBukkit\Plugins\ChestShop.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\ChestShop\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. I like to set "REVERSE_BUTTONS" to "true" so that my signs have a Buy/Sell (BS) pattern that matches the left-click (Buy) and right-click (Sell).
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 22:53:54 [INFO] [ChestShop] Loading ChestShop v3.46
2012-09-10 22:53:57 [INFO] [ChestShop] Enabling ChestShop v3.46
2012-09-10 22:53:57 [INFO] [ChestShop] Vault loaded - using Essentials Economy
9. Start your Minecraft client, connect to your multiplayer server. Drop down a chest next to a wall. Put some stacks of dirt blocks in the chest. Place a sign above the chest on the wall with the following text starting on line #2 (Line #1 is automatically filled out with your loginID):

Code: Select all

1
B 2:1 S
Dirt
10. Have somebody else (a different loginID) left-click the sign to by 1 block of dirt for $2.00 and right-click the sign to sell 1 block of dirt for $1.00.
11. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for ChestShop
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - ChestShop.admin
  moderator
    permissions:
    - ChestShop.mod
  builder:
    permissions:
    - ChestShop.shop.*
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Citizens
Spoiler:
1. Download the latest version (1.2.1 at the time of this document).
2. Extract "Citizens1.2.1.zip" to E:\CraftBukkit\Plugins\ which should create E:\CraftBukkit\Plugins\Citizens.jar and a sub-folder called "Citizens"
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\Citizens\citizens.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 00:18:48 [INFO] [Citizens] Loading Citizens v1.2.1
2012-09-11 00:18:51 [INFO] [Citizens] Enabling Citizens v1.2.1
2012-09-11 00:18:51 [INFO] [Citizens] NPC types loaded: blacksmith, guard, healer, quester, trader, wizard
2012-09-11 00:18:51 [INFO] [Citizens] version [1.2.1] loaded.
2012-09-11 00:18:51 [INFO] [Citizens] Loaded 0 NPCs.
2012-09-11 00:18:51 [INFO] [Citizens] Loaded 0 quests.
9. Start your Minecraft client, connect to your multiplayer server. Stand where you want an NPC. Type "T" for chat mode and type "/npc create Hobbes" and stand back to see the new NPC you created. To delete Hobbes, right-click on him to select him, then type "/npc remove"
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Citizens
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - citizens.admin
    - citizens.npc.remove.all
    - citizens.npc.owner
  builder:
    permissions:
    - citizens.help
    - citizens.npc.age
    - citizens.npc.character.*
    - citizens.npc.create
    - citizens.npc.despawn
    - citizens.npc.edit.equip
    - citizens.npc.edit.path
    - citizens.npc.edit.text
    - citizens.npc.help
    - citizens.npc.list
    - citizens.npc.lookclose
    - citizens.npc.power
    - citizens.npc.remove
    - citizens.npc.rename
    - citizens.npc.select
    - citizens.npc.spawn
    - citizens.npc.talk
    - citizens.npc.tp
    - citizens.npc.tphere
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: DeathTpPlus
Spoiler:
1. Download the latest version (3.9.16.2320 at the time of this document).
2. Copy "DeathTpPlus.jar" to E:\CraftBukkit\Plugins\DeathTpPlus.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\DeathTpPlus\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. I change "informationLogEnabled" to "false" to reduce console clutter.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 01:50:41 [INFO] [DeathTpPlus] Loading DeathTpPlus v3.9.16.2320
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Enabling DeathTpPlus v3.9.16.2320
2012-09-11 01:50:43 [INFO] [DeathTpPlus] allow-wordtravel is: no
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Configuration v.3.4 loaded.
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Config is up to date
2012-09-11 01:50:43 [WARNING] [DeathTpPlus] You are running on an newer CB Version
2012-09-11 01:50:43 [WARNING] [DeathTpPlus] There might be issues, just letting you know
2012-09-11 01:50:43 [INFO] [DeathTpPlus] is up to date at version 3.9.16.2320.
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Loading death messages...
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Deathmessages v.3.5 loaded.
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Loading tomb messages..
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Tombmessages v.3.5 loaded.
2012-09-11 01:50:43 [INFO] [DeathTpPlus] [LOAD] Tombs loaded !
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Successfully loaded 0 TombStones for world world
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Successfully loaded 0 TombStones for world world_nether
2012-09-11 01:50:43 [INFO] [DeathTpPlus] Successfully loaded 0 TombStones for world world_the_end
2012-09-11 01:50:44 [INFO] [DeathTpPlus] v3.9.16.2320 enabled
2012-09-11 01:50:44 [INFO] [DeathTpPlus] Vault detected
2012-09-11 01:50:44 [INFO] [DeathTpPlus] Checking ecnomony providers now!
2012-09-11 01:50:44 [INFO] [DeathTpPlus] Economy provider found: Essentials Economy
9. Start your Minecraft client, connect to your multiplayer server. Get yourself killed, respawn and check where you died and see if you have a landmark where you died.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for DeathTpPlus
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - deathtpplus.admin.*
    - deathtpplus.deathtp.deathtp
    - deathtpplus.tomb.free
    - deathtpplus.tombstone.find
    - deathtpplus.tombstone.large
    - deathtpplus.tombstone.list
    - deathtpplus.tombstone.lockette
    - deathtpplus.tombstone.quickloot
    - deathtpplus.tombstone.reset
    - deathtpplus.tombstone.sign
    - deathtpplus.tombstone.time
    - deathtpplus.tombstone.freechest
    - deathtpplus.tombstone.freesign
    - deathtpplus.worldtravel
  default:
    permissions:
    - deathtpplus.deathtp.deaths
    - deathtpplus.deathtp.kills
    - deathtpplus.deathtp.report
    - deathtpplus.deathtp.streak
    - deathtpplus.deathtp.top
    - deathtpplus.tomb.create
    - deathtpplus.tombstone.lwc
    - deathtpplus.tombstone.use
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: DisguiseCraft
Spoiler:
1. Download the latest version (3.3 at the time of this document).
2. Copy "DisguiseCraft.jar" to E:\CraftBukkit\Plugins\DisguiseCraft.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\DisguiseCraft\DisguiseCraft.cfg
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 08:12:16 [INFO] [DisguiseCraft] Loading DisguiseCraft v3.3
2012-09-11 08:12:18 [INFO] [DisguiseCraft] Enabling DisguiseCraft v3.3
2012-09-11 08:12:18 [INFO] [DisguiseCraft] Version 3.3 is enabled!
9. Start your Minecraft client, connect to your multiplayer server. Type "T" for chat mode and then type "/disguise creeper" and see if your friends see you as a creeper. Then type "/undisguise" to reset your looks.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for DisguiseCraft
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - disguisecraft.other.disguise
    - disguisecraft.other.undisguise
    - disguisecraft.player.*
    - disguisecraft.seer
  builder:
    permissions:
    - disguisecraft.burning
    - disguisecraft.mob.*
    - disguisecraft.notarget
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 334Post LHammonds »

Add a plugin: Electric Fence
Spoiler:
1. Download the latest version (2.1 at the time of this document).
2. Copy "ElectricFence.jar" to E:\CraftBukkit\Plugins\ElectricFence.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\ElectricFence\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired. I change "damage" from 0 to 10 and "radiusDamage" from 0 to 5
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 08:51:52 [INFO] [ElectricFence] Loading ElectricFence v1.9
2012-09-11 08:51:53 [INFO] [ElectricFence] Enabling ElectricFence v1.9
2012-09-11 08:51:53 [INFO] [ElectricFence]: ElectricFence v.1.9has been enabled!
2012-09-11 08:51:53 [INFO] [ElectricFence]: Configuration file loaded
9. Start your Minecraft client, connect to your multiplayer server. Place a redstone torch on top of a fence to power it up. Then touch the fence for a good jolt.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Electric Fence
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - ElectricFence.bypass
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: MachinaCraft
Spoiler:
1. Download the latest version (4.1.5 at the time of this document).
2. Extract only the .jar files from "MachinaCraft-4.1.5.zip" to E:\CraftBukkit\Plugins\ (Should be 8 .jar files)
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open the following files:
- E:\CraftBukkit\plugins\MachinaBuilder\config.yml
- E:\CraftBukkit\plugins\MachinaCore\config.yml
- E:\CraftBukkit\plugins\MachinaDrill\config.yml
- E:\CraftBukkit\plugins\MachinaFactory\config.yml
- E:\CraftBukkit\plugins\MachinaPlanter\config.yml
- E:\CraftBukkit\plugins\MachinaPump\config.yml
- E:\CraftBukkit\plugins\MachinaRedstoneBridge\config.yml
- E:\CraftBukkit\plugins\Hoverpad\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file(s).
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 09:10:53 [INFO] [MachinaCore] Loading MachinaCore v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaFactory] Loading MachinaFactory v4.1.5
2012-09-11 09:10:53 [INFO] [HoverPad] Loading HoverPad v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaPump] Loading MachinaPump v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaBuilder] Loading MachinaBuilder v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaDrill] Loading MachinaDrill v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaRedstoneBridge] Loading MachinaRedstoneBridge v4.1.5
2012-09-11 09:10:53 [INFO] [MachinaPlanter] Loading MachinaPlanter v4.1.5
2012-09-11 09:10:54 [INFO] [MachinaCore] Enabling MachinaCore v4.1.5
2012-09-11 09:10:54 [INFO] MachinaCore version 4.1.5 is now enabled.
2012-09-11 09:10:54 [INFO] [MachinaFactory] Enabling MachinaFactory v4.1.5
2012-09-11 09:10:54 [INFO] MachinaFactory version 4.1.5 is now enabled.
2012-09-11 09:10:54 [INFO] [HoverPad] Enabling HoverPad v4.1.5
2012-09-11 09:10:54 [INFO] HoverPad version 4.1.5 is now enabled.
2012-09-11 09:10:54 [INFO] [MachinaPump] Enabling MachinaPump v4.1.5
2012-09-11 09:10:54 [INFO] MachinaPump version 4.1.5 is now enabled.
2012-09-11 09:10:54 [INFO] [MachinaBuilder] Enabling MachinaBuilder v4.1.5
2012-09-11 09:10:54 [INFO] MachinaBuilder version 4.1.5 is now enabled.
2012-09-11 09:10:56 [INFO] [MachinaDrill] Enabling MachinaDrill v4.1.5
2012-09-11 09:10:56 [INFO] MachinaDrill version 4.1.5 is now enabled.
2012-09-11 09:10:56 [INFO] [MachinaRedstoneBridge] Enabling MachinaRedstoneBridge v4.1.5
2012-09-11 09:10:56 [INFO] MachinaRedstoneBridge version 4.1.5 is now enabled.
2012-09-11 09:10:56 [INFO] [MachinaPlanter] Enabling MachinaPlanter v4.1.5
2012-09-11 09:10:56 [INFO] MachinaPlanter version 4.1.5 is now enabled.
9. Start your Minecraft client, connect to your multiplayer server. Build an item relay. Place a chest with some stuff in it. Place a brick block behind it. Put a wood plank behind the brick block. Put an empty chest one space away from behind the wood plank. Place an iron bar on top of the wood plank. Place a lever on top of the brick block. Pull the lever and see if items are slowly moved from one chest to the other.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for MachinaCraft
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - machinabuilder.deactivate-all
    - machinadrill.deactivate-all
    - machinapump.deactivate-all
  builder:
    permissions:
    - hoverpad.all
    - machinabuilder.activate
    - machinabuilder.deactivate-own
    - machinadrill.activate
    - machinadrill.deactivate-own
    - machinafactory.fabricator
    - machinafactory.itemrelay
    - machinaplanter.activate
    - machinaplanter.harvest
    - machinapump.activate
    - machinapump.deactivate-own
    - machinapump.lava.all
    - machinapump.lava.drain
    - machinapump.lava.fill
    - machinapump.nether-water
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Vault
Spoiler:
NOTE: This is an API to be used by other plugins so you are not going to see anything in-game just yet.

1. Download the latest version (1.2.17 at the time of this document).
2. Copy "Vault.jar" to E:\CraftBukkit\Plugins\Vault.jar
3. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-10 19:35:44 [INFO] [Vault] Loading Vault v1.2.17-b224
2012-09-10 19:35:44 [INFO] [Vault] Enabling Vault v1.2.17-b224
2012-09-10 19:35:44 [INFO] [Vault][Economy] Essentials Economy found: Waiting
2012-09-10 19:35:44 [INFO] [Vault][Permission] bPermissions2 hooked.
2012-09-10 19:35:44 [INFO] [Vault][Permission] bPermissions 2 found: Loaded
2012-09-10 19:35:44 [INFO] [Vault][Permission] SuperPermissions loaded as backup permission system.
2012-09-10 19:35:44 [INFO] [Vault][Chat] bPermissions2 hooked.
2012-09-10 19:35:44 [INFO] [Vault][Chat] bPermssions2 found: Loaded
2012-09-10 19:35:44 [INFO] [Vault] Enabled Version 1.2.17-b224
2012-09-10 19:35:46 [INFO] [Vault][Economy] Essentials Economy hooked.
4. Type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Vault
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - vault.admin
3. Save and close the file.

Add a plugin: MC Jobs
Spoiler:
1. Download the latest version (3.1.4 at the time of this document).
2. Copy "mcjobs.jar" to E:\CraftBukkit\Plugins\mcjobs.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\mcjobs\config.yml and
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 09:48:17 [INFO] [mcjobs] Loading mcjobs v3.1.4
2012-09-11 09:48:18 [INFO] [mcjobs] Enabling mcjobs v3.1.4
2012-09-11 09:48:18 [INFO] [mcjobs] mcMMO has been found.
2012-09-11 09:48:18 [INFO] [mcjobs] Using builtin logging methods.
2012-09-11 09:48:18 [INFO] [mcjobs] Found Vault 1.2.17-b224
2012-09-11 09:48:18 [INFO] [mcjobs] LOADED JOBS: digger miner builder carpenter soldier tinkerer woodsman farmer toolmaker weaponsmith armorer fisherman baker alchemist brewer enchanter theurgist conjurer bulldozer taxes 
2012-09-11 09:48:18 [INFO] [mcjobs] MC Jobs has been enabled!
9. Start your Minecraft client, connect to your multiplayer server. Type "t" to start a chat and type "/jobs join digger" and you should get a message saying you joined the job. Type "/jobs list" to see all jobs. Type "/jobs leave digger" to quit the job.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for MC Jobs
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - mcjobs.admin
    - mcjobs.admin.defaults
    - mcjobs.admin.leavedefault
  default:
    permissions:
    - mcjobs.world.all
    - mcjobs.jobsavail.*
    - mcjobs.jobs.info
    - mcjobs.jobs.join
    - mcjobs.jobs.leave
    - mcjobs.jobs.list
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Multiverse-Core
Spoiler:
1. Download the latest version (2.0-AB at the time of this document).
2. Rename "Multiverse-Core-2.4.jar" to "Multiverse-Core.jar" and copy to E:\CraftBukkit\Plugins\Multiverse-Core.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\Multiverse-Core\config.yml
6. The default settings are typically OK but feel free to look around and tweak as desired.
7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 20:32:44 [INFO] [Multiverse-Core] Loading Multiverse-Core v2.4-b527
2012-09-11 20:32:45 [INFO] [Multiverse-Core] Enabling Multiverse-Core v2.4-b527
2012-09-11 20:32:45 [INFO] [Multiverse-Core] - Version 2.4-b527 (API v14) Enabled - By Rigby, fernferret, lithium3141 and main--
2012-09-11 20:32:45 [INFO] [AllPay] - Version 10.0 - hooked into Essentials Economy for Multiverse-Core v2.4-b527
2012-09-11 20:32:46 [INFO] [Multiverse-Core] Loading World & Settings - 'world' - Env: NORMAL - Type: NORMAL & seed: 9200432392265499231
2012-09-11 20:32:46 [INFO] [Multiverse-Core] Loading World & Settings - 'world_nether' - Env: NETHER - Type: NORMAL & seed: 9200432392265499231
2012-09-11 20:32:46 [WARNING] [Multiverse-Core] Spawn location from world.dat file was unsafe. Adjusting...
2012-09-11 20:32:46 [WARNING] [Multiverse-Core] Original Location: X: 0 Y: 64 Z: 0 P: 0 Y: 0 
2012-09-11 20:32:46 [SEVERE] [Multiverse-Core] New safe spawn NOT found!!!
2012-09-11 20:32:46 [INFO] [Multiverse-Core] Loading World & Settings - 'world_the_end' - Env: THE_END - Type: NORMAL & seed: 9200432392265499231
2012-09-11 20:32:46 [INFO] [Multiverse-Core] 3 - World(s) loaded.
9. Start your Minecraft client, connect to your multiplayer server. Type "t" to start a chat and type the following commands:

** Move to where you want the spawn point set for your existing world **

Code: Select all

/mv set spawn
** Create a new world **

Code: Select all

/mv create coolworld NORMAL
** Teleport to the new world **

Code: Select all

/mv tp coolworld
** Look around and admire your new world! **

** Teleport back to your original world **

Code: Select all

/mv tp world
** Optional: Delete the new world you just created **

Code: Select all

/mv delete coolworld
/mvconfirm
NOTE #1: If you wanted to keep "coolworld" then you may want to update the following files with the world name as noted in the prior respective sections:

Code: Select all

E:\CraftBukkit\Plugins\bPermissions\mirrors.yml
E:\CraftBukkit\Plugins\FoundDiamonds\config.yml
E:\CraftBukkit\Plugins\BloodMoon\config.yml
E:\CraftBukkit\plugins\RealWeather\config.yml
NOTE #2: When you created the world, bPermissions created a world sub-folder under the bPermissions folder. You might want to delete that folder manually.

10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Multiverse-Core
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - multiverse.teleport.other.pl
    - multiverse.teleport.other.p
    - multiverse.teleport.other.ow
    - multiverse.core.create
    - multiverse.core.import
    - multiverse.core.modify
    - multiverse.core.modify.add
    - multiverse.core.modify.clear
    - multiverse.core.modify.modify
    - multiverse.core.modify.remove
    - multiverse.core.modify.set
    - multiverse.core.reload
    - multiverse.core.spawn.other
    - multiverse.core.spawn.self
    - multiverse.core.spawn.set
    - multiverse.core.delete
    - multiverse.core.purge
    - multiverse.core.remove
    - multiverse.core.unload
    - multiverse.core.anchor
    - multiverse.core.config
    - multiverse.core.debug
    - multiverse.core.generator
    - multiverse.core.load
    - multiverse.core.sleep
    - multiverse.core.spout
    - multiverse.core.tp.*
    - multiverse.core.tp.self
  default:
    permissions:
    - multiverse.help
    - multiverse.access.*
    - multiverse.teleport.self.a
    - multiverse.teleport.self.b
    - multiverse.teleport.self.e
    - multiverse.teleport.self.w
    - multiverse.teleport.self.pl
    - multiverse.teleport.self.ca
    - multiverse.teleport.self.p
    - multiverse.teleport.self.ow
    - multiverse.core.confirm
    - multiverse.core.coord
    - multiverse.core.info
    - multiverse.core.list.environments
    - multiverse.core.list.who
    - multiverse.core.list.worlds
    - multiverse.core.version
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Plugins

Post: # 335Post LHammonds »

Add a plugin: MoArrows
Spoiler:
1. Download the latest version (2.4.1 at the time of this document).
2. Rename "MoArrows_v2.4.1.jar" to "MoArrows.jar" and copy to E:\CraftBukkit\Plugins\MoArrows.jar
3. Start your CraftBukkit server (double-click startcb.bat)
4. Once the server starts up and loads the plugin, it will generate the initial configurations. Type "stop" on the server console to gracefully shutdown the server.
5. Use a text editor and open E:\CraftBukkit\plugins\MoArrows\config.yml
6. The default settings will allow any arrow type without requiring any materials. I recommend adding material costs for each type of arrow. You might also want to disable the doombringer arrow because of it's devastating effect...however, this can also be controlled via permissions. Here are the material settings that the author suggests:

explosive-materials: 289x2,377x1
compression-materials: 289x4,377x1
poison-materials: 373:8228x1
lightning-materials: 265x1,266x1,331x1
teleport-materials: 368x1,262x1
razor-materials: 262x4
slow-materials: 373:8202x1
fire-materials: 35x1,263x1,259x1
net-materials: 287x10,262x1
piercing-materials: 262x4,264x1
doombringer-materials: 57x1,118x1,116x1,117x1

7. Save and close the file.
8. Start your CraftBukkit server and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-09 23:38:43 [INFO] [MoArrows] Loading MoArrows v2.4.1
2012-09-09 23:38:44 [INFO] [MoArrows] Enabling MoArrows v2.4.1
2012-09-09 23:38:44 [INFO] [MoArrows] Removed the following arrows: [doombringer]
9. Start your Minecraft client, connect to your multiplayer server. Hold a bow in your hand, left-click to cycle through the available arrow types, right-click to send one flying.
10. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for MoArrows
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - moarrows.bypassmaterials
    - moarrows.reload
    - ^moarrows.use.doombringer
  builder:
    permissions:
    - moarrows.list
    - moarrows.help
    - moarrows.use.normal
    - moarrows.use.poison
    - moarrows.use.explosive
    - moarrows.use.teleport
    - moarrows.use.lightning
    - moarrows.use.slow
    - moarrows.use.razor
    - moarrows.use.piercing
    - moarrows.use.fire
    - moarrows.use.net
    - ^moarrows.use.doombringer
  default:
    permissions:
    - ^moarrows.use.doombringer
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

Add a plugin: Auto Shutdown
NOTE: This is not needed at all for a Linux server but is handy for Windows.
Spoiler:
1. Download the latest version (2.3 at the time of this document).
2. Extract "AutoShutdown-2.3_1.3.1_.zip" to E:\CraftBukkit\Plugins\ which should create E:\CraftBukkit\Plugins\AutoShutdown.jar and a sub-folder called "AutoShutdown"
3 OPTIONAL: I opened AutoShutdown.jar and edited the plugin.yml and changed the version number from 2.2 to 2.3 since it is incorrect.
4. Start your CraftBukkit server (double-click startcb.bat) and be sure you see something like the following somewhere on the console screen (may need to scroll up) (you can also look in Server.log):

Code: Select all

2012-09-11 20:23:12 [INFO] [AutoShutdown] Loading AutoShutdown v2.3
2012-09-11 20:23:14 [INFO] [AutoShutdown] Enabling AutoShutdown v2.3
2012-09-11 20:23:14 [INFO] [AutoShutdown] Shutdown scheduled for Wed Sep 12 03:00:00 CDT 2012
2012-09-11 20:23:14 [INFO] [AutoShutdown] Shutdown scheduled for Wed Sep 12 08:00:00 CDT 2012
2012-09-11 20:23:14 [INFO] [AutoShutdown] Shutdown scheduled for Wed Sep 12 11:00:00 CDT 2012
2012-09-11 20:23:14 [INFO] [AutoShutdown] Shutdown scheduled for Wed Sep 12 14:00:00 CDT 2012
2012-09-11 20:23:14 [INFO] [AutoShutdown] Shutdown scheduled for Wed Sep 12 17:00:00 CDT 2012
2012-09-11 20:23:14 [INFO] [AutoShutdown] Version 2.3 enabled.
5. Type "stop" at the server console to gracefully shutdown the server.
6. Use a text editor and open E:\CraftBukkit\plugins\AutoShutdown\config.yml
7. The default settings are probably not what you will want to use. Here is what the original looks like:

Code: Select all

kickreason: Scheduled Shutdown.
warntimes: 900,600,300,240,180,120,60,45,30,20,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
gracetime: 20
kickonshutdown: true
shutdowntimes: 3:00,8:00,11:00,14:00,17:00
I only want my server being rebooted once per day when nobody is likely to be on it...3am. NOTE: Whenever you have only a single value for time, you must enclose it with single quotes as shown in the below example. If unsure, do not set any times and simply use the "/as set 3:00" command to add the time in chat which will update the config.yml for you.

Code: Select all

kickreason: Scheduled Shutdown.
warntimes: 900,600,300,240,180,120,60,45,30,20,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
gracetime: 20
kickonshutdown: true
shutdowntimes: '3:00'
7. Save and close the file.
8. Start your Minecraft client, connect to your multiplayer server. Type "t" to start a chat and type "/as list" which should show you a list of times the server is scheduled for shutdown.
9. Disconnect from the server, close Minecraft and then type "stop" at the server console to gracefully shutdown the server.
Configure permissions for Auto Shutdown
Spoiler:
NOTE: You can also get a nice list of permissions by typing "/permissions helpme" while in Minecraft chat or by typing "permissions helpme" at the server console which will update the groups.yml and users.yml templates in the bPermissions main folder.

1. Use a text editor and open E:\CraftBukkit\plugins\bPermissions\world\groups.yml
2. Add the following permissions to which ever groups you want (you can see how I assigned them):

Code: Select all

groups:
  admin:
    permissions:
    - autoshutdown.admin
3. Save and close the file.
4. Start CraftBukkit and then the Minecraft client. Connect to your multiplayer world and see if the permissions to the commands work as expected.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu Overview

Post: # 336Post LHammonds »

Ubuntu Server Installation

High-level overview

This section will cover installation of a dedicated Ubuntu server. The server will be installed inside a virtual machine vSphere 4.1 running on ESXi 4.1 servers. Notes will also be supplied for doing the same thing for Oracle's VirtualBox on a Windows 7 PC. Although there are some VMware-specific and VirtualBox-specific steps, they are very few and the majority of this documentation will work for other Virtual Machines or even directly installed onto a physical machine (e.g. bare-metal install).

Custom scripts will also be covered to help automate tasks such as backing up, rebooting and starting CraftBukkit.

This is considered an advanced installation, however, it is written click-for-click so that someone relatively new to Linux would be able to follow.

If you are not looking to setup the server for long-term use or just wanting to test it out, you could just install with the defaults and select "Guided - use entire disk" when asked about partitions and then place a checkmark beside "OpenSSH Server" and skip my notes on installing the server and jump straight down to the configuration section and installing Java/CraftBukkit.

Tools utilized in this process
Assumptions

This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. This variable data will be noted in this section and highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using these "place-holder" values.

Under no circumstance should you use the actual values listed below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.

Wherever you see RED in this document, you need to substitute it for what you will be using.
  • Ubuntu Server name: srv-mc
  • Ubuntu Server IP address: 192.168.107.2
  • Ubuntu Server IP subnet mask: 255.255.255.0
  • Ubuntu Server IP gateway: 192.168.107.1
  • Internal DNS Server 1: 192.168.107.212 (you might not have one)
  • Internal DNS Server 2: 192.168.107.213 (you might not have one)
  • External DNS Server 1: 8.8.8.4 (check with your provider for your DNS server)
  • External DNS Server 2: 8.8.8.5 (check with your provider for your DNS server)
  • Ubuntu Admin ID: administrator
  • Ubuntu Admin Password: myadminpass
  • CraftBukkit ID: craftbukkit
  • CraftBukkit Password: mycbpass
  • Gmail Account: me@gmail.com
  • GMail Password: mygmailpass
It is also assumed that the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it such as nano.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu Analysis and Design

Post: # 337Post LHammonds »

Analysis and Design
Spoiler:
The Ubuntu Server Long-Term Support (LTS) is great choice for companies because it is a solid operating system that happens to be free. If professional support is needed, there is an option to buy support for the Long-Term Support (LTS) versions of the operating system.

The large decision over the configuration of Ubuntu is how the hard drive space is sliced up (partitioned). This documentation will focus on partitioning the drives in such a way that it allows for growth depending on what is needed for the specific application.

Isolating the root volume to mainly just static data that will not grow much over time is a central concern. Pushing the other folders into their own volumes will be done so their dynamic growth will not affect the root partition. Filling up the root volume on a *nix system is a very bad thing and should be avoided at all costs.

The volumes will initially be sliced up as follows:
  • boot - This will remain static in size. It is also the only space residing outside the Logical Volume Manager (LVM)
  • root volume - Operating system and everything else which should remain fairly static.
  • swap volume - This will remain static in size. However, if the amount of RAM is adjusted, this might need to be adjusted as well.
  • home volume - This is where personal files will be stored but likely not be used in most server configurations.
  • tmp volume - This location will be used for temporary storage. Size should be adjusted to match however it is being used.
  • usr volume - This will contain mostly static data and should not grow unexpectedly.
  • var volume - This is the app/database/log storage and will continue to grow over time.
  • srv volume - This will contain the files stored in the Samba share.
  • opt volume - This will contain specific software you add but may not be utilized at all depending on configuration.
  • bak volume - This will contain a local backup of CraftBukkit. So space needs to be about double the size of your data (which will be double the /opt volume).
The partitions will be increased later as needed but will start off with a minimum size.

To get a good idea of the initial hard drive layout and to understand the process better, here is a graphical representation of the initial design for the server:

Image

These numbers will be used for the initial build of the system:

boot = 200 MB
root = 2 GB
swap = 2 GB
home = 0.2 GB
tmp = 0.5 GB
usr = 2.0 GB
var = 2.0 GB
srv = 0.2 GB
opt = 0.2 GB
bak = 0.5 GB

NOTE: When the logical volumes and file systems are initially created, they consume the maximum amount of space allocated so that the file system size will initially equal the logical volume size. These partition sizes above are artificially small for that reason. These will be later modified so that the logical volume will be larger than the file system so that the file system has room to expand when needed in a safe and automated manner.

Important info:
- The /tmp folder is strictly temporary. By default, each time the server reboots, this folder is deleted and re-created.
- The /bak folder will retain the most recent backup and is considered the "local" copy of the backup.
VMware Virtual Machine Settings
Spoiler:
Virtual Manager: VMware vSphere Client 4.1
Virtual Host: VMware ESXi Server 4.1
  • Configuration: Custom
  • Name: srv-mc
  • Datastore: DS3400-LUN0
  • Virtual Machine Version: 7
  • Guest Operating System: Linux, Version: Ubuntu Linux (64-bit)
  • Number of virtual processors: 1
  • Memory Size: 4096 MB
  • Number of NICs: 1
  • NIC 1: VM Network
  • Adapter: E1000, Connect at Power On: Checked
  • SCSI controller: LSI Logic Parallel
  • Select a Disk: Create a new virtual disk
  • Create a Disk: 10 GB, No thin provisioning, No cluster features, Store with the virtual machine
  • Advanced Options: Virtual Device Node = SCSI (0:0)
  • Remove Floppy Drive
  • Mount CD/DVD Drive to Ubuntu ISO (ubuntu-12.04.1-server-amd64.iso). Make sure CD/DVD is set to Connect at power on
  • Set boot options to Force BIOS Setup so you can set CDROM to boot before the Hard Disk
VirtualBox Virtual Machine Settings
Spoiler:
Virtual Manager: Oracle VirtualBox 4.1.22
Virtual Host: Windows 7 Ultimate with SP1 (64-bit)
  • Name: srv-mc
  • Operating System: Linux
  • Version: Ubuntu (64 bit)
  • Memory: 4096 MB
  • Check - Start-up Disk
    - Create new hard disk
    - VMDK
    - Dynamically allocated
    - Size: 10 GB
  • Select srv-mc and click Settings (CTRL+S)
    - System, Processor, Enable PAE/NX
    - Network, Attached to: Bridged Adapter, Advanced, Adapter Type: Intel PRO/1000 MT Server
    - Storage, IDE Controller, Choose a virtual CD/DVD disk file, ubuntu-12.04.1-server-amd64.iso
Install PuTTY
Spoiler:
When running inside a virtual machine, the response time for screen refreshes can be painfully slow to view man (manual) pages and navigating in VI (text editor). However, when using PuTTY via SSH, it is a far better solution for your Ubuntu console because it handles the screen draws much faster when scrolling and allows copying and pasting text between windows.

For example, selecting and copying a command in this document and then right-clicking in the PuTTY window will paste the command and have it ready to execute. Any text/lines highlighted with the mouse will be automatically copied into clipboard memory.

Download the portable edition and run the install...except it does not really "install" like a normal program, it simply extracts to a specified folder and will run from that folder even if you put it on a USB stick and carry over to a new computer (requires no install to run and thus leaves no footprint on your system)
  1. Start PuTTY
  2. Type the following and click the Save button:
    Host Name: SRV-MC (or the IP such as 192.168.107.2)
    Port: 22
    Connection type: SSH
    Saved Sessions: SRV-MC
  3. Now all you have to do is double-click on the session and it will connect to your server (when online).

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu Server Install

Post: # 338Post LHammonds »

Install Ubuntu Server

NOTE: During the setup process throughout this entire document, most commands will require "sudo" as a prefix. However, this document will be using "sudo su" to temporarily gain root privileges so that subsequent commands will work without the need for the "sudo" prefix.
Spoiler:
  1. Power on the Virtual Machine (VM)
  2. Press {ENTER} to accept English
  3. Select Install Ubuntu Server {ENTER}
  4. Press {ENTER} to accept English
  5. Press {ENTER} to accept United States
  6. Select No to not detect keyboard layout
  7. Press {ENTER} to accept English (US)
  8. Press {ENTER} to accept English (US)
  9. Type srv-mc {ENTER} (this is your hostname)
  10. Type Administrator, {ENTER} for the full name
  11. Press {ENTER} to accept the default of the lowercase name of administrator
  12. Type myadminpass, {ENTER}, myadminpass, {ENTER}
  13. Select No, {ENTER} to not encrypt your home directory
  14. Press {ENTER} to accept detected time zone (America/Chicago)
  15. Select Manual {ENTER}
  16. Select SCSI3 (0,0,0) (sda) - 10.7 GB VMware Virtual disk {ENTER}
  17. Select Yes to create new empty partition table, {ENTER}
  18. Select pri/log 10.7 GB FREE SPACE {ENTER}
  19. Select Create a new partition {ENTER}
  20. Type 200MB, {ENTER} (NOTE: This will be the /boot partition)
  21. Select Primary {ENTER}
  22. Select Beginning {ENTER}
  23. Select Use as: Ext4 journaling file system {ENTER}
  24. Select Ext2 file system {ENTER}
  25. Select Mount point: / {ENTER}
  26. Select /boot - static files of the boot loader {ENTER}
  27. Select Label: none {ENTER}
  28. Type boot {ENTER}
  29. Select Bootable flag: off {ENTER} (NOTE: This toggles it on)
  30. Select Done setting up the partition {ENTER}
  31. Select Configure the Logical Volume Manager {ENTER}
  32. Select Yes to write change to disks and configure LVM, {ENTER}
  33. Select Create volume group {ENTER}
  34. Type LVG {ENTER}
  35. Select /dev/sda free #1 (10537MB; FREE SPACE), {SPACEBAR}, {ENTER}
  36. Select Yes to write change to disks and configure LVM, {ENTER}
  37. Select Create logical volume {ENTER}
  38. Select LVG (10531MB) {ENTER}
  39. Type root {ENTER}
  40. Type 2G {ENTER}
  41. Select Create logical volume {ENTER}
  42. Select LVG (8535MB) {ENTER}
  43. Type swap {ENTER}
  44. Type 2G {ENTER} (NOTE: This is double the amount of RAM)
  45. Select Create logical volume {ENTER}
  46. Select LVG (6538MB) {ENTER}
  47. Type home {ENTER}
  48. Type 0.2G {ENTER}
  49. Select Create logical volume {ENTER}
  50. Select LVG (6341MB) {ENTER}
  51. Type tmp {ENTER}
  52. Type 0.5G {ENTER}
  53. Select Create logical volume {ENTER}
  54. Select LVG (5842MB) {ENTER}
  55. Type usr {ENTER}
  56. Type 2G {ENTER}
  57. Select Create logical volume {ENTER}
  58. Select LVG (3846MB) {ENTER}
  59. Type var {ENTER}
  60. Type 2G {ENTER}
  61. Select Create logical volume {ENTER}
  62. Select LVG (1849MB) {ENTER}
  63. Type srv {ENTER}
  64. Type 0.2G {ENTER}
  65. Select Create logical volume {ENTER}
  66. Select LVG (1652MB) {ENTER}
  67. Type opt {ENTER}
  68. Type 0.2G {ENTER}
  69. Select Create logical volume {ENTER}
  70. Select LVG (1455MB) {ENTER}
  71. Type bak {ENTER}
  72. Type 0.5G {ENTER} (we will have a small amount leftover in LVG)
  73. Select Finish {ENTER}
  74. Select #1 2.0 GB directly under LVM VG LVG, LV root, {ENTER}
  75. Select Use as: do not use {ENTER}
  76. Select Ext4 journaling file system {ENTER}
  77. Select Mount point: none {ENTER}
  78. Select / - the root file system {ENTER}
  79. Select Label: none {ENTER}
  80. Type root {ENTER}
  81. Select Done setting up the partition {ENTER}
  82. Select #1 2.0 GB directly under LVM VG LVG, LV swap, {ENTER}
  83. Select Use as: do not use {ENTER}
  84. Select swap area {ENTER}
  85. Select Done setting up the partition {ENTER}
  86. Select #1 197.1 MB directly under LVM VG LVG, LV home, {ENTER}
  87. Select Use as: do not use {ENTER}
  88. Select Ext4 journaling file system {ENTER}
  89. Select Mount point: none {ENTER}
  90. Select /home {ENTER}
  91. Select Label: none {ENTER}
  92. Type home {ENTER}
  93. Select Done setting up the partition {ENTER}
  94. Select #1 499.1 MB directly under LVM VG LVG, LV tmp, {ENTER}
  95. Select Use as: do not use {ENTER}
  96. Select Ext4 journaling file system {ENTER}
  97. Select Mount point: none {ENTER}
  98. Select /tmp {ENTER}
  99. Select Label: none {ENTER}
  100. Type tmp {ENTER}
  101. Select Label: tmp {ENTER}
  102. Select Done setting up the partition {ENTER}
  103. Select #1 2.0 GB directly under LVM VG LVG, LV usr, {ENTER}
  104. Select Use as: do not use {ENTER}
  105. Select Ext4 journaling file system {ENTER}
  106. Select Mount point: none {ENTER}
  107. Select /usr {ENTER}
  108. Select Label: none {ENTER}
  109. Type usr {ENTER}
  110. Select Done setting up the partition {ENTER}
  111. Select #1 2.0 GB directly under LVM VG LVG, LV var, {ENTER}
  112. Select Use as: do not use {ENTER}
  113. Select Ext4 journaling file system {ENTER}
  114. Select Mount point: none {ENTER}
  115. Select /var {ENTER}
  116. Select Label: none {ENTER}
  117. Type var {ENTER}
  118. Select Done setting up the partition {ENTER}
  119. Select #1 197.1 MB directly under LVM VG LVG, LV srv, {ENTER}
  120. Select Use as: do not use {ENTER}
  121. Select Ext4 journaling file system {ENTER}
  122. Select Mount point: none {ENTER}
  123. Select /srv {ENTER}
  124. Select Label: none {ENTER}
  125. Type srv {ENTER}
  126. Select Done setting up the partition {ENTER}
  127. Select #1 197.1 MB directly under LVM VG LVG, LV opt, {ENTER}
  128. Select Use as: do not use {ENTER}
  129. Select Ext4 journaling file system {ENTER}
  130. Select Mount point: none {ENTER}
  131. Select /opt {ENTER}
  132. Select Label: none {ENTER}
  133. Type opt {ENTER}
  134. Select Done setting up the partition {ENTER}
  135. Select #1 499.1 MB directly under LVM VG LVG, LV bak, {ENTER}
  136. Select Use as: do not use {ENTER}
  137. Select Ext4 journaling file system {ENTER}
  138. Select Mount point: none {ENTER}
  139. Select Enter manually {ENTER}
  140. Type /bak {ENTER}
  141. Select Label: none {ENTER}
  142. Type bak {ENTER}
  143. Select Done setting up the partition {ENTER}
  144. Here is what the screen looks like at this point: Partitions
  145. Select Finish partitioning and write changes to disk {ENTER}
  146. Select Yes to write changes to disk, {ENTER}
  147. Press {ENTER} to accept a blank line for the HTTP proxy
  148. Select No automatic updates, {ENTER}
  149. Highlight only OpenSSH server and press {SPACEBAR} to enable, {ENTER} to continue. NOTE: This allows us to use PuTTY after installation to connect to the server.
  150. Select Yes, {ENTER} to install GRUB boot loader to the master boot record
  151. Installation Complete - Press {ENTER} to reboot.
  152. Eject the CD ISO image:
    - For VMware, from the VM menu, select VM --> Edit Settings and select CD/DVD Drive 1 and change to "Client Device" which will effectively remove the ISO.
    - For VirtualBox, from the VM menu, select Devices --> CD/DVD Devices --> Remove disk from virtual drive.
Initial Configurations
Spoiler:
  1. At the login prompt, login with your administrator account (administrator / myadminpass)
  2. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su{ENTER} and then provide the administrator password (myadminpass).
  3. Type vi /etc/network/interfaces {ENTER} and change the following: (We need to change the network interface card (NIC) from using DHCP to a static IP)
    From:

    Code: Select all

    iface eth0 inet dhcp
    To:
    iface eth0 inet static address 192.168.107.2 netmask 255.255.255.0 gateway 192.168.107.1 network 192.168.107.0 broadcast 192.168.107.255 dns-nameservers 192.168.107.212 192.168.107.213 8.8.8.4 8.8.8.5
    NOTE #1: You may need to manually remove the DHCP record (lease) associated to this Ubuntu server from your DHCP server so the correct IP can be found by other machines on the network. This can be avoided by temporarily configuring the VM Network Adapter connection to be "Host Only Network" instead of "VM Network" so the server is isolated during setup...at least until you reach the testing of the static IP below.

    NOTE #2: You might also need to manually add a HOST(A) record to your Windows DNS server if you have one (for srv-mc.mydomain.com and srv-mc.work.mydomain.com)
  4. Restart the network by typing /etc/init.d/networking restart
    NOTE: The above command complains about it being deprecated and to use the following command but it simply does not work...so use the above command for now...not this one: service networking restart
  5. Sanity check! Type ifconfig and make sure the settings are correct. Then type ping http://www.google.com or similar and see if ping works.
  6. Shutdown and power off the server by typing shutdown -P now
  7. At this point forward, you can use PuTTY to access the console rather than the console itself for better performance, ability to scroll, etc.
  8. In VM menu, select VM --> Snapshot --> Take Snapshot. Give it a name like STEP 1 and description of Ubuntu Server 12.04.1 LTS, clean install, Static IP: 192.168.107.2 and click OK
Operating System Patches
Spoiler:
  1. Start the Ubuntu server and connect using PuTTY.
  2. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  3. Install the patches by typing the following commands:

    Code: Select all

    aptitude update
    aptitude safe-upgrade
    
  4. Shutdown and power off the server by typing shutdown -P now
  5. In VM menu, select VM --> Snapshot --> Take Snapshot. Give it a name like STEP 2 and description of Ubuntu Server 12.04.1 LTS, Patches applied, Static IP: 192.168.107.2. The Snapshot Manager should now have a nice hierarchy of snapshots (STEP 1 --> STEP 2 --> You are here)

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu - Managing Space

Post: # 339Post LHammonds »

Volume / Disk Management
Spoiler:
Earlier, it was mentioned that the partition design needed to have some breathing room so that the file system inside can grow as needed. When the volumes were created during setup, the file systems were automatically expanded to fill the entire volume. We will now correct this by adding more "drives" to the system and then extend each logical volume to gain some breathing space.

Most logical volumes will be increased in size and then the file systems contained in them will be increased but not to the maximum amount.

This design will allow growth when needed and ensure that there will be time to add additional hard drives BEFORE they are needed which will keep the administrators from being stuck between a rock and a hard place! Nobody wants to lose a job because somebody did not estimate growth correctly or the budget did not allow for large capacity when the system first rolled out.

Here are the planned adjustments for each logical volume:

root = 2 GB to 3 GB
swap = 2 GB (no change)
home = 0.2 GB to 1 GB
tmp = 0.5 GB to 2 GB
usr = 2.0 GB to 3 GB
var = 2.0 GB to 3 GB
srv = 0.2 GB to 2 GB
opt = 0.2 GB to 2 GB
bak = 0.5 GB to 4 GB

Here are the planned adjustments for each file system:

root = 2 GB (no change)
swap = 2 GB (no change)
home = 0.2 GB to 0.5 GB
tmp = 0.5 GB to 1 GB
usr = 2.0 GB (no change)
var = 2.0 GB (no change)
srv = 0.2 GB to 1 GB
opt = 0.2 GB to 1 GB
bak = 0.5 GB to 2 GB

We started off with a 10 GB drive to hold these volumes but now need 22 GB. For this exercise, we will add two 12 GB drives to cover the additional storage needs. (NOTE: This was an arbitrary number in order to demonstrate how to add additional hard drives to the system)

Here is a graphical representation of what needs to be accomplished:

Image

If we were to type df -h right now, we should see something like this:

Code: Select all

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/LVG-root  1.9G  429M  1.4G  24% /
udev                  489M  4.0K  489M   1% /dev
tmpfs                 200M  244K  199M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  498M     0  498M   0% /run/shm
/dev/sda1             179M   47M  122M  28% /boot
/dev/mapper/LVG-home  187M  9.5M  168M   6% /home
/dev/mapper/LVG-tmp   473M   23M  427M   5% /tmp
/dev/mapper/LVG-usr   1.9G  460M  1.4G  26% /usr
/dev/mapper/LVG-var   1.9G  367M  1.5G  21% /var
/dev/mapper/LVG-srv   187M  9.5M  168M   6% /srv
/dev/mapper/LVG-opt   187M  9.5M  168M   6% /opt
/dev/mapper/LVG-bak   473M   23M  427M   5% /bak
Adding Space to the LVM
Spoiler:
Adding more space in VMware/VirtualBox is easy. In this exercise, each drive will be added as a separate disk just as if we were to add a physical drive to a physical server.

VMware-specific instructions to add drives:
  1. Shutdown and power off the server by typing shutdown -P now
  2. In the vSphere client, right-click the Virtual Machine and choose Edit Settings.
  3. On the hardware tab, click the Add button and select Hard Disk. Click Next, choose "Create a new virtual disk", click Next, set the size to 12 GB, click Next, Next, Finish.
  4. Add another 12 GB disk using the same steps above and click OK to close the settings and allow VMware to process the changes.
VirtualBox-specific instructions to add drives:
  1. Shutdown and power off the server by typing shutdown -P now
  2. In the VirtualBox Manager, right-click the Virtual Machine and choose Settings.
  3. On the Storage tab, select the "SATA Controller" that has your existing hard disk and click the Add (+) button beside it for "Add Hard Disk" and then select "Create new disk", choose your preference such as VDI and click Next, Select Dynamically allocated or Fixed size, click Next, set the size to 12.00 GB and accept the default name/location, click Next, Create
  4. Add another 12 GB disk using the same steps above and click OK to close the settings window.
Collect information about the newly added drives.
  1. Start the server and connect using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass) and then temporarily grant yourself super user privileges by typing sudo su
  3. Type pvdisplay which should show something similar to this:
    --- Physical volume --- PV Name /dev/sda5 VG Name LVG PV Size 9.81 GiB / not usable 3.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 2511 Free PE 228 Allocated PE 2283 PV UUID NkfC3i-ROqv-YuLZ-63VO-RTAU-l01p-suqi4O
    The important bits of info here are the PV Name and VG Name for our existing configuration.
  4. Type fdisk -l which should show something similar to this (however I abbreviated it to show just the important parts):
    Disk /dev/sda: 10.7 GB, 10737418240 bytes Device Boot Start End Blocks Id System /dev/sda1 * 2048 391167 194560 83 Linux /dev/sda2 393214 20969471 10288129 5 Extended /dev/sda5 393216 20969471 10288128 8e Linux LVM Disk /dev/sdb: 12.9 GB, 12884901888 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 12.9 GB, 12884901888 bytes Disk /dev/sdc doesn't contain a valid partition table
    The important bits of info here are the device paths for the new drives which I highlighted in red.
Prepare the first drive (/dev/sdb) to be used by the LVM

Type the following:
fdisk /dev/sdb n (Create New Partition) p (Primary Partition) 1 (Partition Number) {ENTER} (use default for first cylinder) {ENTER} (use default for last cylinder) t (Change partition type) 8e (Set to Linux LVM) p (Preview how the drive will look) w (Write changes)
Prepare the second drive (/dev/sdc) to be used by the LVM

Do the exact same steps as above but start with fdisk /dev/sdc

Create physical volumes using the new drives

If we type fdisk -l, we now see /dev/sdb1 and /dev/sdc1 which are Linux LVM partitions.

Type the following to create physical volumes:

Code: Select all

pvcreate /dev/sdb1
pvcreate /dev/sdc1
Now add the physical volumes to the volume group (LVG) by typing the following:

Code: Select all

vgextend LVG /dev/sdb1
vgextend LVG /dev/sdc1
Now that the space of both drives have been added to the logical volume group called LVG, we can now allocate that space to grow the logical volumes.

To get a list of volume paths to use in the next commands, type lvscan to show your current volumes and their sizes.

Code: Select all

  ACTIVE            '/dev/LVG/root' [1.86 GiB] inherit
  ACTIVE            '/dev/LVG/swap' [1.86 GiB] inherit
  ACTIVE            '/dev/LVG/home' [188.00 MiB] inherit
  ACTIVE            '/dev/LVG/tmp' [476.00 MiB] inherit
  ACTIVE            '/dev/LVG/usr' [1.86 GiB] inherit
  ACTIVE            '/dev/LVG/var' [1.86 GiB] inherit
  ACTIVE            '/dev/LVG/srv' [188.00 MiB] inherit
  ACTIVE            '/dev/LVG/opt' [188.00 MiB] inherit
  ACTIVE            '/dev/LVG/bak' [476.00 MiB] inherit
Type the following to set the exact size of the volume by specifying the end-result size you want:

Code: Select all

lvextend -L3G /dev/LVG/root
lvextend -L1G /dev/LVG/home
lvextend -L2G /dev/LVG/tmp
lvextend -L3G /dev/LVG/usr
lvextend -L3G /dev/LVG/var
lvextend -L2G /dev/LVG/srv
lvextend -L2G /dev/LVG/opt
lvextend -L4G /dev/LVG/bak
or you can grow each volume by the specified amount (the number after the plus sign):

Code: Select all

lvextend -L+1G /dev/LVG/root
lvextend -L+0.8G /dev/LVG/home
lvextend -L+1.5G /dev/LVG/tmp
lvextend -L+1G /dev/LVG/usr
lvextend -L+1G /dev/LVG/var
lvextend -L+1.8G /dev/LVG/srv
lvextend -L+1.8G /dev/LVG/opt
lvextend -L+3.5G /dev/LVG/bak
To see the new sizes, type lvscan

Code: Select all

  ACTIVE            '/dev/LVG/root' [3.00 GiB] inherit
  ACTIVE            '/dev/LVG/swap' [1.86 GiB] inherit
  ACTIVE            '/dev/LVG/home' [1.00 GiB] inherit
  ACTIVE            '/dev/LVG/tmp' [2.00 GiB] inherit
  ACTIVE            '/dev/LVG/usr' [3.00 GiB] inherit
  ACTIVE            '/dev/LVG/var' [3.00 GiB] inherit
  ACTIVE            '/dev/LVG/srv' [2.00 GiB] inherit
  ACTIVE            '/dev/LVG/opt' [2.00 GiB] inherit
  ACTIVE            '/dev/LVG/bak' [4.00 GiB] inherit
The last thing to do now is the actual growth of the file systems. We want to grow the existing file systems but only to a certain amount so we do not take up all the space in the volume. We want room for growth in the future so we have time to order and install new drives when needed.

Code: Select all

resize2fs /dev/LVG/home 500M
resize2fs /dev/LVG/tmp 1G
resize2fs /dev/LVG/srv 1G
resize2fs /dev/LVG/opt 1G
resize2fs /dev/LVG/bak 2G
If we need to increase space in /var at a later point, we can issue the following command without any downtime (we will automate this in a nifty script later):

Code: Select all

resize2fs /dev/LVG/var 2560MB
We could continue to increase this particular file system all the way until we reach the limit of the volume which is 3 GB at the moment.

If we were to type df -h right now, we should see something like this:

Code: Select all

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/LVG-root  1.9G  405M  1.4G  23% /
udev                  2.0G  4.0K  2.0G   1% /dev
tmpfs                 792M  320K  791M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  2.0G     0  2.0G   0% /run/shm
/dev/sda1             179M   47M  122M  28% /boot
/dev/mapper/LVG-home  485M  6.3M  454M   2% /home
/dev/mapper/LVG-tmp   992M   11M  931M   2% /tmp
/dev/mapper/LVG-usr   1.9G  434M  1.4G  25% /usr
/dev/mapper/LVG-var   1.9G  354M  1.4G  20% /var
/dev/mapper/LVG-srv   993M  6.8M  935M   1% /srv
/dev/mapper/LVG-opt   993M  6.8M  935M   1% /opt
/dev/mapper/LVG-bak   2.0G   11M  1.9G   1% /bak
Remember, df -h will tell you the size of the file system and lvscan will tell you the size of the volumes where the file systems live in.

TIP: If you want to see everything in a specific block size, such as everything showing up in megabytes (for consistency), you can use df --block-size m

Shutdown and power off the server by typing shutdown -P now

In VM menu, select VM --> Snapshot --> Take Snapshot. Give it a name like STEP 3 and description of Ubuntu Server 12.04.1 LTS, Storage space adjusted, Static IP: 192.168.107.2. The Snapshot Manager should now have a nice hierarchy of snapshots (STEP 1 --> STEP 2 --> STEP 3 --> You are here)

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu Software Configuration

Post: # 340Post LHammonds »

Software Configurations
Spoiler:
  1. Turn on the server and connect using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. At the $ prompt, type aptitude -y install vim-nox for use instead of the built-in VI editor. more info
  5. At the $ prompt, type aptitude -y install p7zip-full to install 7-zip archive utility.
  6. At the $ prompt, type aptitude -y install htop to install a nice process/memory viewer. (OPTIONAL)
  7. At the $ prompt, type aptitude install sendemail libio-socket-ssl-perl libnet-ssleay-perl for email capability. (OPTIONAL)
  8. Change the default shell from dash to bash. Type ls -l /bin/sh to see that it points to /bin/dash. Type dpkg-reconfigure dash and answer No. Type ls -l /bin/sh and it should now be pointing to /bin/bash
  9. It might be necessary to remove AppArmor to avoid problems by typing the following:

    Code: Select all

    /etc/init.d/apparmor stop
    /etc/init.d/apparmor teardown
    update-rc.d -f apparmor remove
    aptitude remove apparmor apparmor-utils
  10. Reboot the server by typing reboot
VMware Tools - Installation
Spoiler:
VMware Tools need to be installed if the VM is using a VMware host. This will insure maximum performance in a virtual environment.
  1. In the VM toolbar for the VM, click Guest, Install VMware Tools
  2. Connect to the server using PuTTY
  3. At the login prompt, login with your administrator account (administrator / myadminpass)
  4. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  5. Type the following:

    Code: Select all

    mkdir /mnt/cdrom
    mount /dev/cdrom /mnt/cdrom
    ls /mnt/cdrom       ( make sure you see a file such as VMwareTools-8.3.12-653202.tar.gz)
    tar zxvf /mnt/cdrom/VMwareTools* -C /tmp/
    cd /tmp/vmware-tools-distrib/
    ./vmware-install.pl -d
    reboot
    
VMware Tools - Upgrade / Uninstall
Spoiler:
Before the updated version can be installed, the currently installed version must 1st be removed.

To determine which version is installed, run this command:

Code: Select all

grep buildNr /usr/bin/vmware-config-tools.pl
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. Type the following to remove VMware Tools:

    Code: Select all

    vmware-uninstall-tools.pl
    
  5. Now install the new VMware Tools as described in the install section above.
VirtualBox Guest Additions - Installation
Spoiler:
The Guest Additions need to be installed if the VM is using a VirtualBox host. This will insure maximum performance in a virtual environment.
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. You need to perform the following commands to fulfill the prerequisites:

    Code: Select all

    aptitude install dkms
    reboot
    
  5. Connect to the server using PuTTY.
  6. At the login prompt, login with your administrator account (administrator / myadminpass)
  7. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  8. From the VirtualBox menu, click Devices, Install Guest Additions
  9. At the console, type the following:

    Code: Select all

    mkdir -p /mnt/cdrom
    mount /dev/cdrom /mnt/cdrom
    /mnt/cdrom/VBoxLinuxAdditions.run
    
  10. NOTE: The X Windows System drivers will fail to load because this is a headless server with no GUI (which is OK)
  11. To see if the services are running, type /etc/init.d/vboxadd-service status or service vboxadd-service status
VirtualBox Guest Additions - Upgrade
Spoiler:
If VirtualBox is updated on the host machine, each VM also needs the upgraded Guest Additions.

Then mount the CDROM and run the installer just like the above. Reboot after it is upgraded.
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. From the VirtualBox menu, click Devices, Install Guest Additions
  5. At the console, type the following:

    Code: Select all

    mount /dev/cdrom /mnt/cdrom
    /mnt/cdrom/VBoxLinuxAdditions.run
    reboot
    
VirtualBox Guest Additions - Uninstall
Spoiler:
If a VM will be migrated from VirtualBox to something like a VMware, the Guest Additions on the VM will need to be removed.
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. Type the following:

    Code: Select all

    cd /opt/VBox*
    ./uninstall.sh
    
CraftBukkit User Account
Spoiler:
We need to create a user account on Ubuntu that has just enough access to what we want to do...which is to transfer CraftBukkit files and run CraftBukkit.
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su {ENTER} and then provide the administrator password (myadminpass).
  4. Type the following:

    Code: Select all

    adduser craftbukkit
    
    When prompted for a new UNIX password, type mycbpass and just press ENTER to default the answers to Full Name, Room Number, Work Phone, Home Phone and Other.
  5. Now we need a location where this user will operate. Type the following:

    Code: Select all

    mkdir /opt/craftbukkit
    chown craftbukkit:craftbukkit /opt/craftbukkit
    chmod 755 /opt/craftbukkit
    

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Ubuntu File Sharing

Post: # 341Post LHammonds »

Configure Ubuntu for File Sharing

CraftBukkit archives will be stored in this location making it easy for other machines to copy the backups.

This file sharing section is optional but can be handy if you need to swap files between the Linux server and a Windows machine.
Spoiler:
  1. Start the Ubuntu server and connect using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su{ENTER} and then provide the administrator password (myadminpass).
  4. Install Samba by typing aptitude -y install samba smbfs (NOTE: To share a folder with Windows, you just need the samba package, to connect to a Windows share, you need both samba and smbfs)
  5. Type the following commands:

    Code: Select all

    cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
    mkdir -p /srv/samba/share
    chown nobody:nogroup /srv/samba/share/
    chmod 0777 /srv/samba/share
    
  6. Edit the configuration file by typing vi /etc/samba/smb.conf
  7. Change workgroup = WORKGROUP to workgroup = work (you are using the domain alias)
  8. Change:

    Code: Select all

    #   security = user
    to:

    Code: Select all

       security = user
  9. Add the following section to the end of the file:

    Code: Select all

    [share]
    comment = Ubuntu File Server Share
    path = /srv/samba/share
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0755
  10. Save and exit the file.
  11. Restart the samba services to utilize the new configuration by typing:

    Code: Select all

    restart smbd
    restart nmbd
  12. You should now be able to click Start --> Run and type \\srv-mc or \\192.168.107.2 {ENTER} and see an explorer window with a Share folder. Drag-n-drop a file into the Share folder. If it worked, it will not display an error message and you should be able to view it from the server by typing ls -l /srv/samba/share/
  13. Shutdown and power off the server by typing shutdown -P now
  14. In VM menu, select VM --> Snapshot --> Take Snapshot. Give it a name like STEP 4 and description of Ubuntu Server 12.04.1 LTS, File share configured, Static IP: 192.168.107.2. The Snapshot Manager should now have a nice hierarchy of snapshots (STEP 1 --> STEP 2 --> STEP 3 --> STEP 4 --> You are here)
Configure WinSCP for File Sharing
Spoiler:
WinSCP is a nice utility for transferring files between your Windows PC and your server.
  1. Start WinSCP
  2. When you start it the 1st time, it assumes you want a new host and shows that screen. Fill out the following info:
    - Host name: 192.168.107.2
    - Port number: 22
    - User name: craftbukkit
    - Password: mycbpass
    - Protocol: SFTP
    - Checkmark: Allow SCP fallback
  3. Place a checkmark beside Advanced options
  4. Select "Directories" on the left under Environment and set the following:
    - Uncheck: Remember last used directory
    - Remote directory: /opt/craftbukkit
    - Local directory: E:\craftbukkit
  5. Click Save
  6. Save session as: Set the following and click OK:
    - craftbukkit@192.168.107.2
    - Checkmark: "Save password"
  7. Warning: Server's host key not found - Click Yes
  8. All you have to do now when starting WinSCP is double-click on the saved session name and it will show your PC folder on the left and server folder on the right.
  9. NOTE: If you find yourself always going to the plugins sub-folder, modify the session's saved directory paths to go straight to the plugins folder to save you an extra step.
NOTE: Using SSH Key-Authentication is the most secure method so I'd recommend researching and setting that up. That topic is beyond the scope of this thread.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Java and Bash Scripts

Post: # 342Post LHammonds »

Install Java
Spoiler:
This process will install the latest version of Oracle's Java. At the time of this writing, it was Java 1.7 Update 7.
  1. Connect to your server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass)
  3. At the $ prompt, temporarily grant yourself super user privileges by typing sudo su{ENTER} and then provide the administrator password (myadminpass).
  4. Type the following:

    Code: Select all

    aptitude -y install python-software-properties
    add-apt-repository ppa:webupd8team/java
    aptitude update
    aptitude -y install oracle-java7-installer
    
Install CraftBukkit

This process will download the latest recommended build of CraftBukkit. At the time of this writing, it was CraftBukkit 1.3.1-R2.0

Code: Select all

wget "http://dl.bukkit.org/latest-rb/craftbukkit.jar" -O /opt/craftbukkit/craftbukkit.jar
Scripting

Much of the solutions beyond this point involve scripts (programming snippets / automated commands).

In particular, they are Bash Scripts. I chose this due to its popularity and the fact it comes with Ubuntu. I try to make use of what comes with the system without requiring additional software / services unless they really add to the bottom line such as decreasing the time it takes for a process to run or to conserve storage and bandwidth usage.

Let's setup the script location. Type the following commands:

Code: Select all

mkdir -p /var/scripts/data
TIP: Creating the data sub-folder also creates the scripts folder when using the -p option so only one command is needed when creating both folders.

Many scripts make use of the same variables/values and functions so we will be putting them all into a single file so we only need to make a change in one place and it will be reflected immediately in any scripts that make use of it.

/var/scripts/cb-common.conf
Spoiler:

Code: Select all

#############################################
## Name          : cb-common.conf
## Version       : 1.1
## Date          : 2012-09-24
## Author        : LHammonds
## Compatibility : Ubuntu Server 12.04.1 LTS
## Purpose       : Provide common variables and functions for scripts.
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created file.
## 2012-09-24 LTH Can now run screen commands from root.
#############################################

## Global Variables ##
ScriptName="$0"
ScriptDir="/var/scripts"
TempDir="/tmp"
CBBakDir="/bak"
CBDir="/opt/craftbukkit"
ShareDir="/srv/samba/share"
LogDir="/var/log"
Owner="craftbukkit"
Group="craftbukkit"
CBSessionName="CraftBukkit"
AdminEmail="myaccount@gmail.com"
ReportEmail="myaccount@gmail.com"
MAILFILE="${TempDir}/mailfile.$$"

## Global Functions ##
function f_sendmsg()
{
  ## Purpose: Send messages to Minecraft players via the console.
  ## Parameter #1 is the message to send to the console.

  CurrentUser=`whoami`
  ## Make sure the required parameter is not empty.
  if [[ -z "$1" ]]; then
    ## No command given.  Send error message instead.
    echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Restore script tried to send an empty message." | tee -a ${LOGFILE}
    if [ "${CurrentUser}" != "${Owner}" ]; then
      ## Need to switch to the owner account to run the screen command.
      su ${Owner} --command "screen -S ${CBSessionName} -p ${CBSessionName} -X stuff \"[SEVERE] Restore script tried to send an empty message.\""
      ## Send carriage return.
      su ${Owner} --command "screen -S ${CBSessionName} -p ${CBSessionName} -X eval \"stuff \015\""
    else
      ## This script is being run by the owner account.
      screen -S ${CBSessionName} -p ${CBSessionName} -X stuff "[SEVERE] Restore script tried to send an empty message."
      ## Send carriage return.
      screen -S ${CBSessionName} -p ${CBSessionName} -X eval "stuff \015"
    fi
  else
    ## Send command to the console.
    if [ "${CurrentUser}" != "${Owner}" ]; then
      ## Need to switch to the owner account to run the screen command.
      su ${Owner} --command "screen -S ${CBSessionName} -p ${CBSessionName} -X stuff \"$1\""
      ## Send carriage return.
      su ${Owner} --command "screen -S ${CBSessionName} -p ${CBSessionName} -X eval \"stuff \015\""
    else
      ## This script is being run by the owner account.
      screen -S ${CBSessionName} -p ${CBSessionName} -X stuff "$1"
      ## Send carriage return.
      screen -S ${CBSessionName} -p ${CBSessionName} -X eval "stuff \015"
    fi
  fi
}

function f_sendmail()
{
  ## Purpose: Send administrative email message.
  ## Parameter #1 = Subject
  ## Parameter #2 = Body
  ## Requirements: sendemail, libio-socket-ssl-perl, libnet-ssleay-perl
  sendemail -f "${ADMINEMAIL}" -t "${REPORTEMAIL}" -u "${1}" -m "${2}\n\nServer: ${HOSTNAME}\nProgram: ${SCRIPTNAME}\nLog: ${LOGFILE}" -s srv-mail:25 1>/dev/null 2>&1
}

function f_isrunning()
{
  ## Purpose: Check if CraftBukkit is running and return the answer via parameter #1.
  local isrunning=0

  ## This performs a double-check to see if CraftBukkit is running.
  Active=`pidof java`
  if [ -z ${Active} ]; then
    ## CraftBukkit is not running.
    isrunning=0
  else
    ## CraftBukkit is still running.
    isrunning=1
  fi
  if [ -e ${CBDir}/server.log.lck ]; then
    ## CraftBukkit is running.
    isrunning=1
  fi
  return ${isrunning}
}
When adding new scripts, be sure to configure the permissions. Here is a good procedure to use when creating new scripts:

Code: Select all

touch /var/scripts/newscript.sh
chmod 0755 /var/scripts/newscript.sh
chown root:root /var/scripts/newscript.sh
It is easy to overlook or forgot the above procedure so it is best if we create a script to ensure all our permissions are correct! Having it scripted will help keep things in good working order and we can schedule it so we never have to worry about permissions again!

/var/scripts/cb-fixperms.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-fixperms.sh
## Version       : 1.0
## Date          : 2012-09-16
## Author        : LHammonds
## Compatibility : Ubuntu Server 12.04.1 LTS
## Purpose       : Reset all CraftBukkit file permissions
## Run Frequency : As often as needed
## Exit Codes    : (if multiple errors, value is the addition of codes)
##   0 = success
##   1 = failure
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOGFILE="${LogDir}/cb-fixperms.log"
LOCKFILE="${TempDir}/cb-fixperms.lock"
ErrorFlag=0
ReturnValue=0

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so other jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${ScriptName} exit code: ${ErrorFlag}" >> ${LOGFILE}
}

#######################################
##           MAIN PROGRAM            ##
#######################################
if [ -f ${LOCKFILE} ]; then
  ## Lock file detected.  Abort script.
  exit 1
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] cb-fixperms started." >> ${LOGFILE}

## Reset file permissions in CraftBukkit folder.
echo "Resetting file ownership on all CB files..."
chown -R ${Owner}:${Group} ${CBDir}
echo "Resetting CB directory permissions..."
find ${CBDir} -type d -exec chmod 0755 {} \;
echo "Resetting CB file permissions..."
find ${CBDir} -type f -exec chmod 0644 {} \;
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] cb-fixperms completed." >> ${LOGFILE}

## Reset file permissions in the scripts folder.
echo "Resetting file ownership on all scripts..."
chown -R root:root ${ScriptDir}/*
echo "Resetting script directory permissions..."
find ${ScriptDir} -type d -exec chmod 0755 {} \;
echo "Resetting all script permissions..."
chmod 0755 ${ScriptDir}/*.sh
chmod 0644 ${ScriptDir}/*.conf
chown ${Owner}:${Group} ${ScriptDir}/data/crontab.${Owner}
chmod 0600 ${ScriptDir}/data/crontab.*

## Reset file permissions in the log folder.
if [ ! -f ${LogDir}/cb-start.log ]; then
  ## Create the file.
  touch ${LogDir}/cb-start.log
fi
## Correct permissions are needed for the low-rights user to write to the log file.
chown ${Owner}:${Group} ${LogDir}/cb-start.log

## Perform cleanup routine.
f_cleanup
## Exit with the combined return code value.
exit ${ErrorFlag}
Here is an example log file.

/var/log/cb-fixperms.log
Spoiler:

Code: Select all

2012-09-19_11:53:02 [INFO] cb-fixperms started.
2012-09-19_11:53:08 [INFO] cb-fixperms completed.
2012-09-19_11:53:08 [INFO] /var/scripts/cb-fixperms.sh exit code: 0

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Bash Scripts

Post: # 343Post LHammonds »

apt-upgrade

This script will automate and log Ubuntu patches to keep your system updated and secured.

/var/scripts/apt-upgrade.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : apt-upgrade.sh
## Version       : 1.0
## Date          : 2012-06-01
## Author        : LHammonds
## Purpose       : Keep system updated (rather than use unattended-upgrades)
## Compatibility : Verified on Ubuntu Server 12.04 LTS
## Requirements  : Sendemail, run as root
## Run Frequency : Recommend once per day.
## Parameters    : None
## Exit Codes    :
##    0 = Success
##    1 = ERROR: Lock file detected.
##    2 = ERROR: Not run as root user.
##    4 = ERROR: Aptitude update Error.
##    8 = ERROR: Aptitude safe-upgrade Error.
##   16 = ERROR: Aptitude autoclean Error.
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-06-01 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

## Define local variables.
LOGFILE="${LogDir}/apt-upgrade.log"
LOCKFILE="${TempDir}/apt-upgrade.lock"
ErrorFlag=0
ReturnCode=0
APTCMD="$(which aptitude)"

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so subsequent jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
  exit ${ErrorFlag}
}

#######################################
##           MAIN PROGRAM            ##
#######################################

if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "** Script aborted **"
  echo "This script tried to run but detected the lock file: ${LOCKFILE}"
  echo "Please check to make sure the file does not remain when check space is not actually running."
  f_sendmail "ERROR: Script aborted" "This script tried to run but detected the lock file: ${LOCKFILE}\n

\nPlease check to make sure the file does not remain when check space is not actually running.\n\nIf you 

find that the script is not running/hung, you can remove it by typing 'rm ${LOCKFILE}'"
  ErrorFlag=1
  f_cleanup
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

## Requirement Check: Script must run as root user.
if [ "$(id -u)" != "0" ]; then
  ## FATAL ERROR DETECTED: Document problem and terminate script.
  echo -e "ERROR: Root user required to run this script.\n"
  ErrorFlag=2
  f_cleanup
fi

echo "`date +%Y-%m-%d_%H:%M:%S` - Begin script." >> ${LOGFILE}
echo "`date +%Y-%m-%d_%H:%M:%S` --- Aptitude Update" >> ${LOGFILE}
${APTCMD} update > /dev/null 2>&1
ReturnCode=$?
if [[ "${ReturnCode}" -gt 0 ]]; then
  ErrorFlag=4
  f_cleanup
fi
echo "`date +%Y-%m-%d_%H:%M:%S` --- Aptitude Safe-Upgrade" >> ${LOGFILE}
echo "--------------------------------------------------" >> ${LOGFILE}
${APTCMD} safe-upgrade --assume-yes --target-release `lsb_release -cs`-security >> ${LOGFILE} 2>&1
ReturnCode=$?
if [[ "${ReturnCode}" -gt 0 ]]; then
  ErrorFlag=8
  f_cleanup
fi
echo "--------------------------------------------------" >> ${LOGFILE}
echo "`date +%Y-%m-%d_%H:%M:%S` --- Aptitude Autoclean" >> ${LOGFILE}
echo "--------------------------------------------------" >> ${LOGFILE}
${APTCMD} autoclean >> ${LOGFILE} 2>&1
ReturnCode=$?
if [[ "${ReturnCode}" -gt 0 ]]; then
  ErrorFlag=16
  f_cleanup
fi
echo "--------------------------------------------------" >> ${LOGFILE}
echo "`date +%Y-%m-%d_%H:%M:%S` - End script." >> ${LOGFILE}

## Perform cleanup routine.
f_cleanup
Check Storage

The Check Storage script will automate the check for volume usage and increase space when necessary. If you have email support, it will also send you an email notification in the event space had to be increased to accommodate growth.

/var/scripts/cb-check-storage.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-check-storage.sh
## Version       : 1.0
## Date          : 2012-05-11
## Author        : LHammonds
## Purpose       : Check available space for a file system and expand if necessary.
## Compatibility : Verified on Ubuntu Server 12.04 LTS
## Requirements  : sendemail (for email notifications)
## Run Frequency : Recommend once per day for each FS to monitor.
## Parameters    :
##    1 = (Required) File System name (e.g. var)
##    2 = (Required) File System Threshold in MB (e.g. 100)
##    3 = (Required) Amount to increase File System in MB (e.g. 50)
## Exit Codes    :
##    0 = Success (either nothing was done or FS expanded without error)
##    1 = ERROR: Missing or incorrect parameter(s)
##    2 = ERROR: Invalid parameter value(s)
##    4 = ERROR: Lock file detected
##    8 = ERROR: Resize2fs error
##   16 = SEVERE: No room to expand
##   32 = ERROR: Script not run by root user
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-05-11 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

## Define local variables.
LOGFILE="${LogDir}/cb-check-storage.log"
LOCKFILE="${TempDir}/cb-check-storage.lock"
ErrorFlag=0
ReturnCode=0

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so other check space jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
  exit ${ErrorFlag}
}

function f_showhelp()
{
  echo -e "\nUsage : ${ScriptName} FileSystemName ThresholdSizeInMB AmountToIncreaseByInMB\n"
  echo -e "\nExample: ${ScriptName} var 50 50\n"
}

function f_auto-increment()
{
  let RoomInLV=${LVSize}-${FSSize}
  if [[ ${RoomInLV} -gt ${FSIncreaseBy} ]]; then
    ## There is room in the LV to increase space to the FS.
    resize2fs ${FSVol} ${NewFSSize}M
    ReturnCode=$?
    echo "`date +%Y-%m-%d_%H:%M:%S` --- resize2fs ${FSVol} ${NewFSSize}M, ReturnCode=${ReturnCode}" | tee -a ${LOGFILE}
    if [[ ${ReturnCode} -ne 0 ]]; then
      ## There was an error in resize2fs.
      return ${ReturnCode}
    fi
  else
    ## There is not enough room in the LV to increase space in the FS.
    return 50
  fi
  return 0
}

#######################################
##           MAIN PROGRAM            ##
#######################################

if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "Check space script aborted"
  echo "This script tried to run but detected the lock file: ${LOCKFILE}"
  echo "Please check to make sure the file does not remain when check space is not actually running."
  f_sendmail "ERROR: check storage script aborted" "This script tried to run but detected the lock file: ${LOCKFILE}\n\nPlease check to make sure the file does not remain when check space is not actually running.\n\nIf you find that the script is not running/hung, you can remove it by typing 'rm ${LOCKFILE}'"
  ErrorFlag=4
  f_cleanup
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

## Requirement Check: Script must run as root user.
if [ "$(id -u)" != "0" ]; then
  ## FATAL ERROR DETECTED: Document problem and terminate script.
  echo "ERROR: Root user required to run this script."
  echo ""
  ErrorFlag=32
  f_cleanup
fi

## Check existence of required command-line parameters.
case "$1" in
  "")
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  --help|-h|-?)
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  *)
    FSName=$1
    ;;
esac
case "$2" in
  "")
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  --help|-h|-?)
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  *)
    FSThreshold=$2
    ;;
esac
case "$3" in
  "")
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  --help|-h|-?)
    f_showhelp
    ErrorFlag=1
    f_cleanup
    ;;
  *)
    FSIncreaseBy=$3
    ;;
esac

## Check validity of File System name.
case "${FSName}" in
  "root")
    FSVol="/dev/LVG/root"
    FSMap="/dev/mapper/LVG-root"
    ;;
  "home")
    FSVol="/dev/LVG/home"
    FSMap="/dev/mapper/LVG-home"
    ;;
  "tmp")
    FSVol="/dev/LVG/tmp"
    FSMap="/dev/mapper/LVG-tmp"
    ;;
  "usr")
    FSVol="/dev/LVG/usr"
    FSMap="/dev/mapper/LVG-usr"
    ;;
  "var")
    FSVol="/dev/LVG/var"
    FSMap="/dev/mapper/LVG-var"
    ;;
  "srv")
    FSVol="/dev/LVG/srv"
    FSMap="/dev/mapper/LVG-srv"
    ;;
  "opt")
    FSVol="/dev/LVG/opt"
    FSMap="/dev/mapper/LVG-opt"
    ;;
  "bak")
    FSVol="/dev/LVG/bak"
    FSMap="/dev/mapper/LVG-bak"
    ;;
  *)
    echo "ERROR: ${FSName} does not match a known file system defined in this script."
    f_showhelp
    ErrorFlag=2
    f_cleanup
    ;;
esac

## Check validity of threshold value.
test ${FSThreshold} -eq 0 1>/dev/null 2>&1
if [[ $? -eq 2 ]]; then
  ## Threshold parameter is not an integer.
  echo "ERROR: ${FSThreshold} is not an integer."
  f_showhelp
  ErrorFlag=2
  f_cleanup
fi

## Check validity of increment value.
test ${FSIncreaseBy} -eq 0 1>/dev/null 2>&1
if [[ $? -eq 2 ]]; then
  ## FSIncreaseBy parameter is not an integer.
  echo "ERROR: ${FSIncreaseBy} is not an integer."
  f_showhelp
  ErrorFlag=2
  f_cleanup
fi

## Get available space for the file system.
FSAvailable="`df --block-size=m ${FSMap} | awk '{ print $4 }' | tail -n 1 | sed 's/M//'`"

## Get the current size of the File System.
FSSize="`df --block-size=m ${FSMap} | awk '{ print $2 }' | tail -n 1 | sed 's/M//'`"

## Get the current size of the Logical Volume for the File System
LVSize="`lvs --noheadings --nosuffix --units=m ${FSMap} | awk '{ print $4}' | sed 's/[.].*//'`"

## Calculate the new size of the FS in case we need it.
let NewFSSize=${FSSize}+${FSIncreaseBy}

if [[ ${FSAvailable} -lt ${FSThreshold} ]]; then
  echo "`date +%Y-%m-%d_%H:%M:%S` - Starting expansion of ${FSVol}" | tee -a ${LOGFILE}
  echo "`date +%Y-%m-%d_%H:%M:%S` --- LVSize=${LVSize}MB, FSSize=${FSSize}MB, FSAvail=${FSAvailable}MB, FSThreshold=${FSThreshold}MB, FSIncreaseBy=${FSIncreaseBy}MB" | tee -a ${LOGFILE}
  ## Run the auto-expansion function.
  f_auto-increment
  ReturnCode=$?
  case ${ReturnCode} in
  0)
    f_sendmail "NOTICE: File System Expanded" "${FSVol} was expanded because it was nearing max capacity.  Please review disk space usage and plan appropriately. LVSize=${LVSize}MB, FSSize=${FSSize}MB, FSAvailable=${FSAvailable}MB, FSThreshold=${FSThreshold}MB, FSIncreaseBy=${FSIncreaseBy}MB"
    echo "`date +%Y-%m-%d_%H:%M:%S` - NOTICE: File System Expanded" "${FSVol} was expanded because it was nearing max capacity.  Please review disk space usage and plan appropriately. LVSize=${LVSize}MB, FSSize=${FSSize}MB, FSAvailable=${FSAvailable}MB, FSThreshold=${FSThreshold}MB, FSIncreaseBy=${FSIncreaseBy}MB" | tee -a ${LOGFILE}
    ;;
  50)
    echo "`date +%Y-%m-%d_%H:%M:%S` - SEVERE: No room to expand ${FSVol}" | tee -a ${LOGFILE}
    ErrorFlag=16
    f_sendmail "SEVERE: No room to expand ${FSVol}" "There is not enough room in the Logical Volume to expand the ${FSVol} File System.  Immediate action is required.  Make sure there is free space in the Volume Group 'LVG' and then expand the Logical Volume...then expand the File System.\n\nLVSize=${LVSize}MB, FSSize=${FSSize}MB, FSAvailable=${FSAvailable}MB, FSThreshold=${FSThreshold}MB, FSIncreaseBy=${FSIncreaseBy}MB.\n\nType 'vgs' to see if there is any free space in the Volume Group which can be given to the Logical Volume.\n\nType 'lvs' to see the current sizes of the LVs.\n\nType 'lvdisplay' to see a list of Logical Volumes so you can get the LV Name which is used in the lvextend and resize2fs commands.\n\nType 'lvextend -L+50M /dev/LVG/var' if you want to extend the var Logical Volume by 50 megabytes (assuming there is 50MB available in the Volume Group).\n\nType 'df --block-size=m' to see a list of file systems and their associated size and available space.\n\nType 'resize2fs /dev/LVG/var ${NewFSSize}M' to set the size of var to ${NewFSSize} megabytes. Make sure you set the size to the desired end-result which should be LARGER than the current FS size so you do not lose data."
    ;;
  *)
    echo "`date +%Y-%m-%d_%H:%M:%S` - ERROR: Expansion failure for ${FSVol}" | tee -a ${LOGFILE}
    ErrorFlag=8
    f_sendmail "ERROR: File System Expansion Failed" "${FSVol} Expansion failed with return code of ${ReturnCode}.  LVSize=${LVSize}MB, FSSize=${FSSize}MB, FSAvailable=${FSAvailable}MB, FSThreshold=${FSThreshold}MB, FSIncreaseBy=${FSIncreaseBy}MB"
    ;;
  esac
  echo "`date +%Y-%m-%d_%H:%M:%S` - Finished expansion of ${FSVol}" | tee -a ${LOGFILE}
else
  echo "`date +%Y-%m-%d_%H:%M:%S` - ${FSVol} ${FSAvailable}M>${FSThreshold}M No action required." | tee -a ${LOGFILE}
fi

## Perform cleanup routine.
f_cleanup
Example Log File

/var/log/cb-check-storage.log
Spoiler:

Code: Select all

2012-09-30_01:00:01 - /dev/LVG/root 1375M>500M No action required.
2012-09-30_01:15:01 - /dev/LVG/home 454M>100M No action required.
2012-09-30_01:30:01 - /dev/LVG/tmp 679M>100M No action required.
2012-09-30_01:45:01 - /dev/LVG/usr 897M>100M No action required.
2012-09-30_02:00:02 - /dev/LVG/var 1143M>100M No action required.
2012-09-30_02:15:01 - /dev/LVG/srv 1568M>100M No action required.
2012-09-30_02:30:01 - /dev/LVG/opt 455M>100M No action required.
2012-09-30_02:45:01 - /dev/LVG/bak 451M>100M No action required.
CraftBukkit Startup

The start script is designed to be run as the low-rights user and will run every minute of the day. It will only start the CraftBukkit server if it is not already running.

/var/scripts/cb-start.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-start.sh
## Version       : 1.0
## Date          : 2012-09-16
## Author        : LHammonds
## Compatibility : Ubuntu Server 12.04.1 LTS
## Purpose       : Start CraftBukkit
## Run Frequency : Designed to run every minute.
## Exit Codes    : None
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOGFILE="${LogDir}/cb-start.log"
RAM2Use="3072M"

## Check if CraftBukkit is running.
f_isrunning
CBRunning=$?

if [ ${CBRunning} -eq 1 ]; then
  ## CraftBukkit is running.
  echo "[INFO] CraftBukkit is already running."
  exit 0
fi

## Startup CraftBukkit
cd ${CBDir}
screen -d -m -S ${CBSessionName} -t ${CBSessionName} java -d64 -Xincgc -Xmx${RAM2Use} -jar ${CBDir}/craftbukkit.jar nogui
echo "`date +%Y-%m-%d_%H:%M:%S` - [INFO] CraftBukkit started." | tee -a ${LOGFILE}
exit 0
Example Log File

/var/log/cb-start.log
Spoiler:

Code: Select all

2012-09-26_04:06:01 - [INFO] CraftBukkit started.
2012-09-27_04:06:01 - [INFO] CraftBukkit started.
2012-09-28_04:06:01 - [INFO] CraftBukkit started.
2012-09-29_04:06:01 - [INFO] CraftBukkit started.
2012-09-30_04:06:01 - [INFO] CraftBukkit started.
Reboot Server

The reboot script will gracefully shutdown the CraftBukkit server if it is running and give notification messages to connected players in advance of the reboot.

/var/scripts/cb-reboot.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-reboot.sh
## Version       : 1.0
## Date          : 2012-09-16
## Author        : LHammonds
## Compatibility : Verified on Ubuntu Server 12.04, CB 1.3.1-R2.0
## Purpose       : Reboot the CraftBukkit server.
## Run Frequency : Once per day or as needed.
## Exit Codes    : None
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOGFILE="/var/log/cb-reboot.log"
LOCKFILE="/tmp/cb-reboot.lock"

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so subsequent jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
}

#######################################
##           MAIN PROGRAM            ##
#######################################

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Reboot started." | tee -a ${LOGFILE}


if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Aborting script.  Lock file detected - ${LOCKFILE}" | tee -a ${LOGFILE}
  exit 1
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

## Check if CraftBukkit is running.
f_isrunning
CBRunning=$?

if [ ${CBRunning} -eq 1 ]; then
  ## Inform players of a pending reboot.
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Notifying users about reboot." | tee -a ${LOGFILE}
  f_sendmsg "say [WARNING] Server reboot in 5 minutes"
  sleep 60
  f_sendmsg "say [WARNING] Server reboot in 4 minutes"
  sleep 60
  f_sendmsg "say [WARNING] Server reboot in 3 minutes"
  sleep 60
  f_sendmsg "say [WARNING] Server reboot in 2 minutes"
  sleep 60
  f_sendmsg "say [WARNING] Server reboot in 1 minute"
  sleep 30
  f_sendmsg "say [WARNING] Server reboot in 30 seconds"
  sleep 15
  f_sendmsg "say [WARNING] Server reboot in 15 seconds"
  sleep 5
  f_sendmsg "say [WARNING] Server reboot in 10 seconds"
  sleep 5
  f_sendmsg "say [WARNING] Server reboot in 5"
  sleep 1
  f_sendmsg "say [WARNING] Server reboot in 4"
  sleep 1
  f_sendmsg "say [WARNING] Server reboot in 3"
  sleep 1
  f_sendmsg "say [WARNING] Server reboot in 2"
  sleep 1
  f_sendmsg "say [WARNING] Server reboot in 1"
  f_sendmsg "save-all"
  f_sendmsg "stop"
  sleep 10
fi

f_cleanup
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Reboot completed." | tee -a ${LOGFILE}
## Flush file system buffers.
sync
sleep 5
## Reboot the server.
shutdown -r now
Example Log File

/var/log/cb-reboot.log
Spoiler:

Code: Select all

2012-09-29_04:00:01 [INFO] Reboot started.
2012-09-29_04:00:01 [INFO] Notifying users about reboot.
2012-09-29_04:05:10 [INFO] Reboot completed.
2012-09-30_04:00:01 [INFO] Reboot started.
2012-09-30_04:00:01 [INFO] Notifying users about reboot.
2012-09-30_04:05:10 [INFO] Reboot completed.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Bash Scripts

Post: # 344Post LHammonds »

Backup Synchronization

The purpose of this sync script is to ensure a local copy of the server is made. It will inform players that a backup is being made while in-game. It will be run multiple times throughout the day.

NOTE: This only updates the local copy of the CraftBukkit server which means it will run very quickly even if you have very large worlds. By itself, it does not provide snapshots in time to restore prior points in time. For that, you will need the archive script.

/var/scripts/cb-rsync.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-rsync.sh
## Version       : 1.1
## Date          : 2012-09-26
## Author        : LHammonds
## Purpose       : Backup CraftBukkit to local folder (even if CB is running)
## Compatibility : Verified on Ubuntu Server 12.04, CB 1.3.1-R2.0
## Run Frequency : Designed to run as needed.
## Exit Codes    :
##   0 = success
##   1 = lock file detected (same script already running)
##   2 = rsync failure
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
## 2012-09-19 LTH Added stat info to log file.
## 2012-09-26 LTH Removed log lock file in target folder after sync.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOCKFILE="${TempDir}/cb-rsync.lock"
LOGFILE="${LogDir}/cb-rsync.log"
RsyncFailure=0
ErrorFlag=0

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so other rsync jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${ScriptName} exit code: ${ErrorFlag}" >> ${LOGFILE}
}

#######################################
##           MAIN PROGRAM            ##
#######################################

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Rsync started." | tee -a ${LOGFILE}

if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Aborting script.  Lock file detected - ${LOCKFILE}" | tee -a ${LOGFILE}
  exit 1
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

## Check if CraftBukkit is running.
f_isrunning
CBRunning=$?

if [ ${CBRunning} -eq 1 ]; then
  ## An online backup must be performed while CraftBukkit is running.
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] CraftBukkit is running." | tee -a ${LOGFILE}
  f_sendmsg "say [INFO] Backup started"
  f_sendmsg "save-off"
  f_sendmsg "save-all"
  sleep 5
fi

## Sync files with local copy.
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] rsync files from ${CBDir} to ${CBBakDir}." | tee -a ${LOGFILE}
rsync -apogHK --delete --exclude=*.pid ${CBDir} ${CBBakDir} 1>/dev/null 2>&1
ReturnValue=$?
if [ ${ReturnValue} -ne 0 ]; then
  ## Fatal error detected.
  RsyncFailure=1
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Backup failed to rsync ${CBDir} to ${CBBakDir}. Return Code = ${ReturnValue}" | tee -a ${LOGFILE}
  if [ ${CBRunning} -eq 1 ]; then
    ## Let online players know that backup failed.
    f_sendmsg "say [SEVERE] Backup failed"
  fi
else
  ## Rsync completed without error.
  if [ ${CBRunning} -eq 1 ]; then
    ## Let online players know that backup completed.
    f_sendmsg "say [INFO] Backup completed"
  fi
fi

if [ ${CBRunning} -eq 1 ]; then
  f_sendmsg "save-on"
fi

if [ ${RsyncFailure} -eq 1 ]; then
  ## Abort script with failure code.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Backup script aborted." | tee -a ${LOGFILE}
  ErrorFlag=2
fi

## Remove lock file from backup folder.
if [ -f "${CBBakDir}/server.log.lck" ]; then
  rm ${CBBakDir}/server.log.lck
fi

## Record some stats to the log file.
CBSize=`du -sh ${CBDir} | awk '{ print $1 }'`
CBBakSize=`du -sh ${CBBakDir} | awk '{ print $1 }'`
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${CBDir} --> ${CBSize}" | tee -a ${LOGFILE}
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${CBBakDir} --> ${CBBakSize}" | tee -a ${LOGFILE}

f_cleanup
exit ${ErrorFlag}
Example Log File

/var/log/cb-rsync.log
Spoiler:

Code: Select all

2012-09-30_06:00:01 [INFO] Rsync started.
2012-09-30_06:00:01 [INFO] CraftBukkit is running.
2012-09-30_06:00:07 [INFO] rsync files from /opt/craftbukkit to /bak.
2012-09-30_06:00:10 [INFO] /opt/craftbukkit --> 480M
2012-09-30_06:00:10 [INFO] /bak --> 480M
2012-09-30_06:00:10 [INFO] /var/scripts/cb-rsync.sh exit code: 0
2012-09-30_07:00:01 [INFO] Rsync started.
2012-09-30_07:00:01 [INFO] CraftBukkit is running.
2012-09-30_07:00:06 [INFO] rsync files from /opt/craftbukkit to /bak.
2012-09-30_07:00:09 [INFO] /opt/craftbukkit --> 480M
2012-09-30_07:00:09 [INFO] /bak --> 480M
2012-09-30_07:00:09 [INFO] /var/scripts/cb-rsync.sh exit code: 0
Archive Backup / Snapshot

This archive script will create a compressed archive of the local backup folder and store it in the Samba share. Depending on the size of your CraftBukkit server, this process can take some time. Be sure to keep in mind how long this process can take when scheduling it. (e.g. If it takes an hour to create the archive, don't schedule it every 30 minutes). Since the compression requires CPU, it is recommended that this is scheduled during off-peak hours.

The archived files will allow you to restore your server at various points in time unlike the backup folder which is usually kept in sync with the current version.

/var/scripts/cb-archive.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-archive.sh
## Version       : 1.0
## Date          : 2012-09-16
## Author        : LHammonds
## Compatibility : Verified on Ubuntu Server 12.04, CB 1.3.1-R2.0
## Purpose       : Archive/Snapshot the CraftBukkit copy.
## Run Frequency : Designed to run as needed.
## Exit Codes    :
##   0 = success
##   1 = lock file detected (same script already running)
##   2 = lock file detected (rsync script)
##   4 = archive creation failure
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
## 2012-09-19 LTH Added stat info to log file.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOCKFILE="${TempDir}/cb-archive.lock"
RSYNCLOCKFILE="${TempDir}/cb-rsync.lock"
LOGFILE="${LogDir}/cb-archive.log"
ArchivePattern="_craftbukkit.tar.7z"
ARCHIVEFILE="`date +%Y-%m-%d-%H-%M`${ArchivePattern}"
RsyncFailure=0
ErrorFlag=0

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so other rsync jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${ScriptName} exit code: ${ErrorFlag}" >> ${LOGFILE}
}

#######################################
##           MAIN PROGRAM            ##
#######################################

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Archive started." | tee -a ${LOGFILE}

if [ -f ${RSYNCLOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Aborting script.  Lock file detected - ${LOCKFILE}" | tee -a ${LOGFILE}
  exit 2
fi

if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Aborting script.  Lock file detected - ${LOCKFILE}" | tee -a ${LOGFILE}
  exit 1
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Creating archive ${ShareDir}/${ARCHIVEFILE}" | tee -a ${LOGFILE}
## Create archive of the recently sync'd backup folder.
tar -cpf - ${CBBakDir} | 7za a -si -mx=9 -w${TempDir} ${ShareDir}/${ARCHIVEFILE} 1>/dev/null 2>&1
ReturnValue=$?
if [ ${ReturnValue} -ne 0 ]; then
  ## Fatal error detected.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Backup failed to create archive. Return Code = ${ReturnValue}" | tee -a ${LOGFILE}
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Backup script aborted." | tee -a ${LOGFILE}
  ErrorFlag=4
else
  ## Record some stats to the log file.
  ArchiveSize=`ls -lh "${ShareDir}/${ARCHIVEFILE}" | awk '{ print $5 }'`
  FolderSize=`du -sh ${CBBakDir} | awk '{ print $1 }'`
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] ${CBBakDir} --> ${FolderSize}, compressed to ${ArchiveSize}" | tee -a ${LOGFILE}
fi
f_cleanup
exit ${ErrorFlag}
Example Log File

/var/log/cb-archive.log
Spoiler:

Code: Select all

2012-09-19_11:06:58 [INFO] Archive started.
2012-09-19_11:06:58 [INFO] Creating archive /srv/samba/share/2012-09-19-11-06_craftbukkit.tar.7z
2012-09-19_11:10:27 [INFO] /bak --> 409M, compressed to 228M
2012-09-19_11:10:27 [INFO] /var/scripts/cb-archive.sh exit code: 0
Purge Old Archives

The purge script will delete the oldest archives from the Samba share. It is based on total number of files to keep in that folder (e.g. "FilesToKeep" variable). You will need to determine what that setting will be by looking at the current size of an archive file and making sure x number of those files will comfortably fit in the space allocated to the Samba share. For example, if your archives are 100 MB each and your Samba share (/srv) is 2 GB, the maximum number of files it can contain (at this size) is 20. Since each archive will grow over time, the likely number to use in this situation is probably 10. To keep more, either increase the size of the srv file system or be sure to copy the archives someplace else such as an external USB drive for long-term storage.

/var/scripts/cb-purge.sh
Spoiler:

Code: Select all

#!/bin/bash
#############################################
## Name          : cb-purge.sh
## Version       : 1.0
## Date          : 2012-09-16
## Author        : LHammonds
## Compatibility : Verified on Ubuntu Server 12.04.1
## Purpose       : Delete old backup files based on number of files to keep.
## Run Frequency : Can run as often as needed.
## Exit Codes    : None
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-16 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOGFILE="${LogDir}/cb-purge.log"
ArchivePattern="_craftbukkit.tar.7z"

#FilesToKeep is the amount of archives to keep at any time.
FilesToKeep=10
Count=0

echo "`date +%Y-%m-%d_%H:%M:%S` ${0} [INFO] Purge started. FilesToKeep=${FilesToKeep}" | tee -a ${LOGFILE}

for Filename in `ls -t ${ShareDir}/*${ArchivePattern}`
do
  if [ ${Count} -lt ${FilesToKeep} ]; then
    ## Do nothing for the 1st amount of files.
    echo "Skipping ${Filename}" | tee -a ${LOGFILE}
  else
    ## Files greater than the amount indicated need to be deleted.
    echo "Deleting ${Filename}" | tee -a ${LOGFILE}
    rm ${Filename}
  fi
  Count=$((${Count} + 1))
done
echo "`date +%Y-%m-%d_%H:%M:%S` ${0} [INFO] Purge completed." | tee -a ${LOGFILE}
Example Log File

/var/log/cb-purge.log
Spoiler:

Code: Select all

2012-09-29_01:30:01 [INFO] Purge started. FilesToKeep=5
Skipping /srv/samba/share/2012-09-25-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-26-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-27-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-28-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-29-02-30_craftbukkit.tar.7z
Deleting /srv/samba/share/2012-09-24-02-30_craftbukkit.tar.7z
2012-09-29_01:30:01 [INFO] Purge completed.
2012-09-30_01:30:01 [INFO] Purge started. FilesToKeep=5
Skipping /srv/samba/share/2012-09-26-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-27-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-28-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-29-02-30_craftbukkit.tar.7z
Skipping /srv/samba/share/2012-09-30-02-30_craftbukkit.tar.7z
Deleting /srv/samba/share/2012-09-25-02-30_craftbukkit.tar.7z
2012-09-30_01:30:01 [INFO] Purge completed.
Restore CraftBukkit

WARNING: Since this script is trying to restore CraftBukkit, make sure you disable the CraftBukkit user's crontab schedule which tries to start up the server anytime it is not running! Once the restore is finished and verified to be working well, then re-enable the cb-start.sh script in the crontab schedule.

The restore script is an interactive script designed to be run by the root user. It will guide you in the process to restore the server from an existing backup archive.

It is also non-destructive which means it will preserve your current world in a backup location unless you specify otherwise.

The script will display which archives you would like to restore from and if the server is running, it will verify if you want to shut it down. The process gives you many chances to abort the script before doing anything.

/var/scripts/cb-restore.sh
Spoiler:

Code: Select all

#!/bin/sh
#############################################
## Name          : cb-restore.sh
## Version       : 1.0
## Date          : 2012-09-19
## Author        : LHammonds
## Compatibility : Verified on Ubuntu Server 12.04, CB 1.3.1-R2.0
## Purpose       : Restore CraftBukkit from prior backup.
## Run Frequency : Designed to run on demand.
## Exit Codes    : None
################ CHANGE LOG #################
## DATE       WHO WHAT WAS CHANGED
## ---------- --- ----------------------------
## 2012-09-19 LTH Created script.
#############################################

## Import standard variables and functions. ##
source /var/scripts/cb-common.conf

LOCALBACKUPDEV="/dev/mapper/LVG-bak"
LOGFILE="/var/log/cb-restore.log"
LOCKFILE="/tmp/cb-restore.lock"
CBSaveDir="/opt/cb-b4-restore"
ArchivePattern="_craftbukkit.tar.7z"
NoBackup=0
ErrorFlag=0

## Make sure the CB folder exists.
if [ ! -d "${CBDir}" ]; then
  ## Make the folder.
  mkdir ${CBDir}
fi

#######################################
##            FUNCTIONS              ##
#######################################

function f_cleanup()
{
  if [ -f ${LOCKFILE} ];then
    ## Remove lock file so subsequent jobs can run.
    rm ${LOCKFILE} 1>/dev/null 2>&1
  fi
}

function f_checkspace()
{
  ## Need to check and see if there is enough space available
  ## to move CraftBukkit to a backup location.
  FreeSpace=`df -k ${LOCALBACKUPDEV} | grep ${LOCALBACKUPDEV} | awk '{ print $4 }'`
  BackupSize=`du -sk ${CBDir} | awk '{ print $1 }'`

  if [ ${BackupSize} -gt ${FreeSpace} ]; then
    echo "There is not enough freespace available to archive CraftBukkit."
    echo "The size is ${BackupSize} kb, Free space is ${FreeSpace} kb"
    echo ""
    echo "To override and not make a backup 1st, use the --nobackup option."
    echo ""
    echo "Example:  ${ScriptName} --nobackup"
    echo ""
    f_cleanup
    exit 1
  fi
}

#######################################
##           MAIN PROGRAM            ##
#######################################

if [ -f ${LOCKFILE} ]; then
  # Lock file detected.  Abort script.
  echo "Restore aborted."
  echo "This script tried to run but detected the lock file: ${LOCKFILE}"
  echo "Please check to make sure their is not another restore running."
  exit 1
else
  echo "`date +%Y-%m-%d_%H:%M:%S` ${ScriptName}" > ${LOCKFILE}
fi

# Determine if we are going to backup existing folder or not.
if [ "$1" = "--nobackup" ]; then
  NoBackup=1
else
  NoBackup=0
  f_checkspace
fi

## Check to make sure the archive folder exists.
if [ ! -d "${CBBakDir}" ]; then
  ## ERROR: Archive folder does not exist.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] The archive folder does not exist!  ${CBBakDir}, EC=1" | tee -a ${LOGFILE}
  f_cleanup
  exit 1
fi

clear

## Define user prompt using the special PS3 variable.
PS3="Type number for the desired archive or 'q' to quit: "

echo "           C R A F T B U K K I T   R E S T O R E"
echo "           -------------------------------------"
## Get sorted list of all archives (newest at the bottom).
FileList=$(find ${CBBakDir}/*${ArchivePattern} -maxdepth 1 -type f | sort -f)

## Prompt user to select a file to use.
## NOTE: If it is a long list, user can scroll up if
##       using PuTTY to see older files.
select GetFile in ${FileList}; do
  if [ "${GetFile}" != "" ]; then
    Filename=${GetFile}
  fi
  break
done

if [ "${Filename}" = "" ]; then
  ## User opted to quit.
  echo -e "Exiting restore program.\n"
  f_cleanup
  exit 0
fi

echo -e "\nSelected file: ${Filename}\n"
read -p "Are you absolutely sure you wish to restore (y/n)? "

if [ "${REPLY}" != "y" ]; then
  echo -e "\n\nRestore aborted.\n\n"
  f_cleanup
  exit 0
fi

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Restore started." | tee -a ${LOGFILE}

## Check if CraftBukkit is running.
f_isrunning
CBRunning=$?

if [ ${CBRunning} -eq 1 ]; then
  ## CraftBukkit is running.
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] CraftBukkit running." | tee -a ${LOGFILE}

  ## Ask user if it is ok to shutdown the server.
  echo -e "\nRestore cannot continue if CraftBukkit is running\n"
  read -p "Do you wish to shutdown the server (y/n)? "
  if [ "${REPLY}" = "y" ]; then
    echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Shutting down server." | tee -a ${LOGFILE}
    f_sendmsg "stop"
    sleep 5
  else
    echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Not shutting down server. Restore aborted." | tee -a ${LOGFILE}
    exit 0
  fi
fi

## CraftBukkit is shutdown at this point.

## Move the current folder (unless otherwise specified).

if [ ${NoBackup} -eq 1 ]; then
  ## Leave current production folder alone.
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] 'No Backup' override specified, skipping folder move." | tee -a ${LOGFILE}
else
  ## Move production folder to backup location.
  echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Moving from ${CBDir} to ${CBSaveDir}." | tee -a ${LOGFILE}
  mv ${CBDir} ${CBSaveDir}
  ReturnValue=$?
  if [ ${ReturnValue} -ne 0 ]; then
    ## Could not move to backup location.
    ## Document the error and terminate script.
    echo ""
    echo "ERROR: The move was not successful. Return value = ${ReturnValue}" | tee -a ${LOGFILE}
    echo ""
    echo "COMMAND was 'mv ${CBDir} ${CBSaveDir}'" | tee -a ${LOGFILE}
    echo ""
    echo "CraftBukkit is currently stopped. An unknown amount of files were"
    echo "restored from the source.  That means there some files are still"
    echo "in ${CBDir} and some files were moved to ${CBSaveDir}"
    echo "This needs to be resolved before you can start the services back up."
    echo "Either move the files back or delete all files and run the restore."
    f_cleanup
    exit 99
  fi
fi

echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Restoring files from ${Filename}" | tee -a ${LOGFILE}

if [ ! -d ${CBDir} ]; then
  mkdir -p ${CBDir}
fi

## Extract the entire contents of the archive back to its original location.
7za x -so -w/tmp ${Filename} | tar -C ${CBDir} --extract --strip-components=2 --file -
ReturnValue=$?
if [ ${ReturnValue} -ne 0 ]; then
  ## Extract command failed.  Display warning message.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Extract return value = {$ReturnValue}" | tee -a ${LOGFILE}
  f_cleanup
  exit 1
fi

if [ -f ${CBDir}/server.log.lck ]; then
  ## Remove the lock file since we know the server is not running.
  rm ${CBDir}/server.log.lck
fi

if [ ! -f ${CBDir}/craftbukkit.jar ]; then
  ## Something is not right...at least this file should exist here.
  ## NOTE: This is not a guarentee all files were restored, it is just a quick check.
  echo "`date +%Y-%m-%d_%H:%M:%S` [SEVERE] Missing file(s).  Did not find ${CBDir}/craftbukkit.jar" | tee -a ${LOGFILE}
  exit 1
fi

chown -R ${Owner}:${Group} ${CBDir}
chmod 0644 -R ${CBDir}

if [ -d ${CBSaveDir} ]; then
  echo -e "\n\nDon't forget to purge ${CBSaveDir} once everything is running smoothly again.\n\n"
fi

## If we got this far, we need to let user know to start the CB server.
echo -e "\nDon't forget to start the server.  ./cb-start.sh\n"

f_cleanup
echo "`date +%Y-%m-%d_%H:%M:%S` [INFO] Restore completed." | tee -a ${LOGFILE}
Example Log File

/var/log/cb-restore.log
Spoiler:

Code: Select all

2012-09-19_15:14:15 [INFO] Restore started.
2012-09-19_15:14:15 [INFO] Moving from /opt/craftbukkit to /opt/cb-b4-restore.
2012-09-19_15:14:15 [INFO] Restoring files from /bak/2012-09-19-14-45_craftbukkit.tar.7z
2012-09-19_15:14:36 [INFO] Restore completed.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 871
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Re: How to setup a trick'd out CraftBukkit server (1.3.1-R2.

Post: # 345Post LHammonds »

CraftBukkit Crontab Scheduling

Login to the server console as the craftbukkit user and make sure the crontab.craftbukkit file is created as noted below.

/var/scripts/data/crontab.craftbukkit

Code: Select all

########################################
# Name: Crontab Schedule for craftbukkit user
# Author: LHammonds
############# Update Log ###############
# 2012-09-16 - LTH - Created schedule
########################################

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Crontab SYNTAX:
# minute(0-59) hour(0-23) day-of-month(1-31) month(1-12) day-of-week(0-6) command-to-execute
#
# Start CraftBukkit
#
0-59 * * * * /var/scripts/cb-start.sh > /dev/null 2>&1
To enable the schedule, type the following:

Code: Select all

crontab < /var/scripts/data/crontab.craftbukkit
To disable the schedule, type the following:

Code: Select all

touch /tmp/empty.txt
crontab < /tmp/empty.txt
rm /tmp/empty.txt
Root Crontab Scheduling

Login to the server console as administrator and type sudo su to temporarily grant yourself root access and make sure the crontab.root file is created as noted below.

/var/scripts/data/crontab.root

Code: Select all

########################################
# Name: Crontab Schedule for root user
# Author: LHammonds
############# Update Log ###############
# 2012-09-16 - LTH - Created schedule
########################################

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Crontab SYNTAX:
# minute(0-59) hour(0-23) day-of-month(1-31) month(1-12) day-of-week(0-6) command-to-execute
#
# Adjust the time clock
#
0 1-23 * * * /usr/sbin/ntpdate ntp.ubuntu.com > /dev/null 2>&1
#
# Fix Permissions
#
@reboot /var/scripts/cb-fixperms.sh > /dev/null 2>&1
#
# Keep CraftBukkit in sync with backup folder
#
0 1-23 * * * /var/scripts/cb-rsync.sh > /dev/null 2>&1
#
# Purge Old CraftBukkit Archives
#
30 1 * * * /var/scripts/cb-purge.sh > /dev/null 2>&1
#
# Backup CraftBukkit with compressed archives (snapshots of backup folder)
#
30 2 * * * /var/scripts/cb-archive.sh > /dev/null 2>&1
#
# Daily checks for available space
#
0 1 * * * /var/scripts/cb-check-storage.sh root 500 100 > /dev/null 2>&1
15 1 * * * /var/scripts/cb-check-storage.sh home 100 50 > /dev/null 2>&1
30 1 * * * /var/scripts/cb-check-storage.sh tmp 100 50 > /dev/null 2>&1
45 1 * * * /var/scripts/cb-check-storage.sh usr 100 50 > /dev/null 2>&1
0 2 * * * /var/scripts/cb-check-storage.sh var 100 50 > /dev/null 2>&1
15 2 * * * /var/scripts/cb-check-storage.sh srv 100 50 > /dev/null 2>&1
30 2 * * * /var/scripts/cb-check-storage.sh opt 100 50 > /dev/null 2>&1
45 2 * * * /var/scripts/cb-check-storage.sh bak 100 50 > /dev/null 2>&1
#
# Daily Ubuntu software upgrade check
#
0 3 * * * /var/scripts/apt-upgrade.sh > /dev/null 2>&1
#
# Daily reboot
#
0 4 * * * /var/scripts/cb-reboot.sh > /dev/null 2>&1
To enable the schedule, type the following:

Code: Select all

crontab < /var/scripts/data/crontab.root
To disable the schedule, type the following:

Code: Select all

touch /tmp/empty.txt
crontab < /tmp/empty.txt
rm /tmp/empty.txt

Post Reply