Raised This Month: $32 Target: $400
 8% 

Scheduled automatic restarts


Post New Thread Reply   
 
Thread Tools Display Modes
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 09-26-2016 , 11:32   Re: Scheduled automatic restarts
Reply With Quote #11

Quote:
Originally Posted by Snaggle View Post
You can set the commands to run at specific timestamps, you just configure the cron to do so, it might require multiple jobs to be created but it can be done.

Code:
50 4 * * * console sm_print {green}This server will be restarting in {red}10 minutes!
55 4 * * * console sm_print {green}This server will be restarting in {red}5 minutes!
59 4 * * * console sm_print {green}This server will be restarting in {red}1 minute!
0 5 * * * console quit
That would trigger the warnings at 04:50, 04:55 and 04:59 before sending the quit command at 5AM each day. I don't know if it's the most optimal way of writing that, but it would work.
So I tried this:
Code:
30 17 * * * console say Server will restart in 10 minutes!
31 17 * * * console say Server will restart in 9 minutes!
To send a message 5.30pm and then 5.31pm. Though both were sent 21 seconds after the clock hit the time. Is there a way to set seconds? Because then I could also warn 30 seconds before restart
condolent is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 09-26-2016 , 11:46   Re: Scheduled automatic restarts
Reply With Quote #12

FYI it is probably bad practice to restart the server with players on it... your best bet is to have the timer tick, and once it hits 0, wait until the server empties out before issuing the "quit" command (also will cause a graceful server exit).
Potato Uno is offline
Snaggle
AlliedModders Donor
Join Date: Jul 2010
Location: England
Old 09-26-2016 , 11:48   Re: Scheduled automatic restarts
Reply With Quote #13

I don't know about seconds, but I would assume something like this might be it...
Code:
30/30 17 * * *
My understanding is that would be
Code:
5:30:30

Last edited by Snaggle; 09-26-2016 at 11:49.
Snaggle is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 09-26-2016 , 11:51   Re: Scheduled automatic restarts
Reply With Quote #14

Quote:
Originally Posted by Snaggle View Post
I don't know about seconds, but I would assume something like this might be it...
Code:
30/30 17 * * *
That didn't seem to work, said it couldn't parse the number
condolent is offline
Snaggle
AlliedModders Donor
Join Date: Jul 2010
Location: England
Old 09-26-2016 , 11:55   Re: Scheduled automatic restarts
Reply With Quote #15

I had a quick Google, but most of the answers appear to say that you cannot run seconds. You would have to trigger whatever it is you want triggered on the minute mark and have whatever is triggered sleep for the additional time (30 seconds) before running the job.

Edit: In which case, would something like this work?
Code:
30 17 * * * * console say "SERVER RESTART IN 30 seconds"; wait 30; "quit"

Last edited by Snaggle; 09-26-2016 at 11:57.
Snaggle is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 09-26-2016 , 14:28   Re: Scheduled automatic restarts
Reply With Quote #16

Ok so I managed to create a scheduled shutdown.
I've made a batch file that opens both my servers:
Code:
@echo off
cd "C:\Users\Administrator\Desktop"
start RUN-JAILBREAK

cd "C:\Users\Administrator\Desktop"
start RUN-DM

exit
RUN-DM & RUN-JAILBREAK are shortcuts to the actual server.

And it's tasked in scheduler, though it won't open the server consoles. The servers go up and there's a process for each server but no console shows up. Guessing I need some sort of parameter to show it?

I can also add that if I run the batch manually, both server consoles shows up like normal

Last edited by condolent; 09-26-2016 at 14:30.
condolent is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-27-2016 , 00:21   Re: Scheduled automatic restarts
Reply With Quote #17

i think if you have sedirector lite you can setup schedules
__________________
8guawong is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode