mark2devel / mark2

Minecraft Multi Server Wrapper Written in Python with Twisted; Pull Requests HIGHLY Encouraged, Collaborators Needed Discord: https://discord.gg/zymJygHNpv
Other
207 stars 44 forks source link

Scheduled restarts #103

Closed ghost closed 3 years ago

ghost commented 6 years ago

Hi there,

I am currently not really experienced with the way mark2 uses schedulers.

I am wondering if it is possible to reboot the server every hour, for example. I'd also like to know how I am able to achieve this.

Thanks a lot!

Kind regards,

Combustible commented 5 years ago

You'll need to enable the scripts system with these settings in your mark2.properties file:

plugin.script.enabled=true
plugin.script.path=mark2-scripts.txt

Then create the file mark2-scripts.txt in the same directory as mark2.properties and put this in it:

# The 'scripts' plugin uses a cron-like syntax.

# TIME FORMAT
# similar to cron - http://www.adminschoice.com/crontab-quick-reference
# currently does not support ','
# all examples are given for the 'minute' field:
#    *       run every minute
#    0       run on the hour
#    */5     run every 5 minutes
#    0-30/5  run every 5 minutes for the first half hour of every hour

# EVENT FORMAT
# instead of specifying a time, you may specify an event to listen out for.
# a list of available events can be seen by running ~events from console.
# to use, replace the time spec with '@eventname', e.g. '@serverstopped'

# COMMAND FORMAT
#    #       print the # and everything following it to the mark2 console
#    /       run a minecraft command
#    ~       run a mark2 command
#    $       execute a shell command, you can define the shell to use in your
#            mark2.properties. each line of the command's stdout will be
#            interpreted as one of the above.
#

#    #----------------------------- Minute (0 - 59)
#    |    #------------------------ Hour   (0 - 23)
#    |    |    #------------------- Day of the Month (1 - 31)
#    |    |    |    #-------------- Month  (1 - 12)
#    |    |    |    |    #--------- Day of the Week (0 - 6)
#    |    |    |    |    |    #---- Command to run
#    |    |    |    |    |    |

     05   *    *    *    *    ~restart

This would restart on the 5th minute past every hour.

Column01 commented 3 years ago

Closed to cleanup issues