TransWikia.com

How do I run a command at a certain time of day (IRL)?

Arqade Asked by Jrud on December 30, 2020

I need to find a plugin or rig up some command blocks that will run console commands at specific times a day. The most basic need is for the /restart command, but I also have world edit commands I want to run on some schedules too.

I have a spigot server on 1.15.2, command blocks, placeholderAPI with the localtime extension, and the ability to install other plugins of course.

How can I make this happen?

One Answer

I have my server running inside a screen session. I can then use cron (or anything else, for that matter) to send commands to that screen session.

As an example, here's how i broadcast that i'm about to shut down the server. Adjust the command to your taste

/usr/bin/screen -p 0 -S ftb -X eval 'stuff "say SERVER SHUTTING DOWN. Saving map..."15'
  • -p lets you select which window to attach to.
  • -S lets you select a named session to attach to.
  • -X is the command you want to send

look here for more info on the screen command if you need it

Hopefully that'll let you do what you need.

edit:foolishly, i assumed you were using linux...simply because i am.

Answered by bionicdude on December 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP