With BukkitCLI you can define and execute commands on the servers command line. With a CallbackHandler you can handle possible output. It will work as an API for other plugins to use and may support native ways of command triggering.
You need to be in control of the server minecraft is running on. This plugin wont wont work if you have no rights on the underlying server.
I recommend to group commands into little scripts and execute them instead of complex commands via BukkitCLI. You can run commands through bash but JavaRuntime does not do this by default. See examples for more information.
package de.wrenchbox.test; import org.bukkit.plugin.java.JavaPlugin; import de.wrenchbox.cli.BukkitCLI; import de.wrenchbox.cli.jobs.CallbackHandler; public class TestPlugin extends JavaPlugin { @Override public void onEnable() { if (!getDataFolder().exists()) { getDataFolder().mkdirs(); } // print the current working directory. should be the server root // [13:24:21 INFO]: [TestPlugin] Current directory: /home/amshaegar/workspace/Minecraft BukkitCLI.createJob("pwd", new CallbackHandler() { @Override public void execute(int exitCode, String out, String err) { getLogger().info(String.format("Current directory: %s", out)); } }); // create a file 'last_run' in the plugin directory // plugins/TestPlugin/last_run BukkitCLI.createJob("touch last_run", getDataFolder()); // print the system date and time // [13:24:21 INFO]: [TestPlugin] System time: So 25. Mai 13:24:21 CEST 2014 BukkitCLI.createJob("date", getDataFolder(), new CallbackHandler() { @Override public void execute(int exitCode, String out, String err) { if (exitCode == 0) { getLogger().info(String.format("System time: %s", out)); } else { getLogger().warning(err); } } }); } }