Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-28-2017, 11:30 PM
Fridgecritter
Hill Giant
 
Join Date: Feb 2008
Posts: 188
Default Automatic server restart using task manager

I am using Server 2016 and I need to accomplish a few things automatically every 6 hours:

Shut down the server
Run two queries on the database one at a time (they run quick)
Bring the server back up

So I tried using the windows task scheduler, made two batch files, one for each query I needed to run, and then made 4 scheduled tasks...

6PM take down server (calls t_server_stop.bat)

6:01 Run query1 (calls to a batch file that runs mysql --user=root --password=mypass peq < c:\query1.sql)

6:02 Run query2 (calls to a batch file that runs mysql --user=root --password=mypass peq < c:\query2.sql)

6:03 Bring server back up (calls t_server_start.bat)

But for some reason it brings the server down, runs the two batch files but doesn't bring the server back up. And I set the tasks to be run even if the user isn't logged on, and run with admin privileges)

So, I'm thinking of consolidating it all into one batch file, but I don't know how to do that. Once it logs into the mysql prompt, dos commands like sleep, etc... don't work. Can someone school me and teach me something about creating a batch file to call a combination of dos commands and mysql commands, so I can have task scheduler call one batch file and be done with it? Thanks a ton in advance.
Reply With Quote
 


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 07:59 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3