Curious I have a resource that needs to be restarted every 30 minutes roughly, now usually i’d just do this in console ‘restart XXXX’
How can i get a .bat file or something of the like to automatically restart the resource every 30 minutes? I can write .bat files, i am just not sure how to impliment it in as the only way to get that command to work would be through the console, unless i put something in the server.cfg that runs on loop?
Why would you need to restart a resource? Restarting resources on a live server is a very bad practice. Try putting whatever the script does inside a loop instead. Mind sharing what resource you have that needs to be restarted?
How is this related to something that restarts a specific resource exactly? As this topic is not about restarting servers.
Sure it’s possible. If you have a schedule just run a resource on the server, that triggers client events to notify them each x minutes, each time decreasing the remaining time before the server restarts. Though if you want to go into more detail on this, create your own topic please
In that case I suggest you report this to the developer who made the ELS resource, as this clearly shouldn’t happen in the first place, restarting a resource should never be necessary. However, if you really want to restart it, simply create a resource like this on the server and it should work.
local delay = 1000 * 60 * 30 -- just edit this to your needed delay (30 minutes in this example)
while true do
I haven’t tried this but I assume it would work fine as long as your resource has permission to execute that command.
To give it permissions just add this to your server.cfg file.
add_ace resource.<resource name for the script above> command.restart allow
add_ace resource.<resource name for the script above> command.start allow
add_ace resource.<resource name for the script above> command.stop allow