0

I've setup Minecraft with Dynmap and it works like it should. Though I would like it to run a specific command every hour.

I start the server by running a file called run.bat which looks like this

java -Xmx1024M -jar craftbukkit.jar -o true
PAUSE

This starts the server and the Dynmap plugin. I can then execute commands in the cmd window that opens to do different things.

The command that I want to execute every hour looks like this:

dynmap fullrender world and is executed in an already started program, is it possible to schedule a command in cmd so that it is executed once every hour?

2
  • This information is available in a lot of places on the internet, and on this forum if you search. Using the terms you entered I found numerous resources that explain it.
    – Taegost
    Commented Jul 22, 2013 at 13:57
  • You won't be able to do this except from another plugin or a server wrapper. If you're on Windows, I made yams.in which now allows scheduling of any command directly into the console. Commented Jul 22, 2013 at 17:11

2 Answers 2

2

You can use the Windows Task Scheduler to schedule it. From the steps here: http://windows.microsoft.com/en-us/windows7/schedule-a-task

Open Task Scheduler by clicking the Start button Picture of the Start button, clicking Control Panel, clicking System and Security, clicking Administrative Tools, and then double-clicking Task Scheduler.‌ Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.

Click the Action menu, and then click Create Basic Task.

Type a name for the task and an optional description, and then click Next.

Do one of the following:

To select a schedule based on the calendar, click Daily, Weekly, Monthly, or One time, click Next; specify the schedule you want to use, and then click Next.

To select a schedule based on common recurring events, click When the computer starts or When I log on, and then click Next.

To select a schedule based on specific events, click When a specific event is logged, click Next; specify the event log and other information using the drop-down lists, and then click Next.

To schedule a program to start automatically, click Start a program, and then click Next.

Click Browse to find the program you want to start, and then click Next.

Click Finish.

3
  • I know I can start a program from the task scheduler but I need to execute dynmap fullrender world in an already started program. Commented Jul 22, 2013 at 13:59
  • Your question wasn't clear at all on that point, you need to update your original question or you're going to get a lot of people giving you this same information.
    – Taegost
    Commented Jul 22, 2013 at 14:00
  • Updated my question Commented Jul 22, 2013 at 14:03
1

Try something like:

> for /L %i in (1,1,24) do timeout /T 3600 <command>

3600 represents a time in seconds.

60 × 60 = 3600s

The command for will loop from 1 to 24, running timeout... each time, which waits 3600 seconds and then executes the command.

See page: timeout command.

1
  • I'm on Win 10 and with such syntax it doesn't work saying "ERROR: Invalid syntax. Default option is not allowed more than '1' time(s)." So, I've just put a "&" before the command making it for /L %i in (1,1,5) do timeout /T 10 & <command>. The only disadvantage is that it prints "Waiting for 0 seconds, press a key to continue ..." all the time between the command executions.
    – RAM237
    Commented May 31, 2019 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .