logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Server Restart, Defrag and run NwNx

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Nathan



Joined: 12 May 2008
Posts: 4

PostPosted: Tue Jan 08, 2013 10:37    Post subject: Server Restart, Defrag and run NwNx Reply with quote

Hi can anyone help me set up a schedule to run every 3 days.

1. Shutdown nwnserver
2. Shutdown nwnx
3. Restart windows
4. Run a defrag
5. load nwnx

Have been running a nwn server for about 7 years now and ive never learnt to do this. Would help things run smoother if im not around to do it myself.

Any help would be great.
Back to top
View user's profile Send private message Visit poster's website
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Tue Jan 08, 2013 18:42    Post subject: Reply with quote

Now that you post that, I realize how horrible Windows is for automation compared to its unix rivals.

Hmmmmmmmmm. Welll, let's see.

You could use event scheduler, I forget if there is a Microsoft one with the OS or a 3rd party one you can download, since I don't use those things, but I remember seeing MS had one awhile back.

The first thing you'll want is a batch file to run, and its going to call a program called taskkill -- you're going to axe the watchdog so your server doesn't try to restart while your computer is shutting down.

The second thing you'll want is to run a mysql command line and stuff a SQL statement into your database (and setup NWNX to check for it later). You may be able to do this with a pipe (|) directive to cmd in your batch file using type. Basically, the file typed would contain your SQL statements, and a command to exit the mysql prompt. This is sort-of-similar to "cat" in Unix. I'm sure this will not be good to you -- play around with it, and you may have to use something else instead of cmd (or type, for that matter).

Thirdly your server's heartbeat npc presumably every 15 mins or so will check to see if a reboot order is in the DB. If it is, he shouts and does the shutdown sequence and gives players time to logoff. Finally, the server shuts down.

Using an event manager, the one that fired your batch file, (and you have everything perfectly timed that hte NWN server should be shut down by now) you tell the system to reboot.

I think using msconfig - and very carefully I should add - I think you can create startup directives when your computer boots. You can then put in your remaining goals of defrag and load nwnx.

There is probably a cleaner way to do it. In fact, I'd bet on it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group