Best way to schedule a daily server restart

Hi !

I’m looking for the best way to restart a server on a windows 2K3 server. In this forum i saw two kind of solutions :

  1. A program document with :

    nserver -c “Restart Server”

  2. A batch file executed by the windows scheduler with :

    net stop “Lotus Domino Server (LotusDominoData)”

    net start “Lotus Domino Server (LotusDominoData)”

In this forum, I saw a lot of “loop” issue with the first solution. Concerning the second solution, I don’t really like to use the windows scheduler (can’t run as service…need to be logged).

Can you tell me what is your point of view ?

Thanks in advance,

Julien


www.domlike.net

Subject: Best way to schedule a daily server restart

You can use “crontab” to execute the net stop command followed by shutdown command (restart the OS)

Crontab: (runs as windows service)

http://www.kalab.com/freeware/cron/cron.htm

I recommend a OS restart few min after net stop is issued as not all the time Domino comes down clean. Sometimes it just stuck & in that case a OS restart will resolve that

Subject: Best way to schedule a daily server restart

Hi, this is what you want if you really want to reboot your Domino server every day.

This shuts down Domino as gracefully as possible, which is probably what you want if you are having such problems that you want to recycle Domino every day. This also reboots the operating system: works on Windows NT/2000/2003

  1. Save this as a batch file (example c:\batch\dominomaintenance.bat)

  2. Ensure that you have the Windows Scheduler Service Running

  3. At the CMD prompt, generate this command to add this to the scheduler. If you use the CMD prompt instead of the GUI interface for the Scheduler Service, it will generate the job under the SYSTEM account instead of the account you are logged in to Windows with, which is what you want.

  4. You may need to download the timeout.exe command which is part of the Windows NT/2000/or 2003 Resource Kit. I believe it can be downloaded for free from the Microsoft website.

C:\at.exe 03:00 /interactive /every:M,T,W,T,F,SA,SU c:\batch\dommaintenance.bat

BEGIN CODE (to be saved in the batch file)

@REM drop users and cache - where D:\lotus\domino is your program directory

D:

cd \lotus\domino

NSERVER.EXE -c “drop all”

NSERVER.EXE -c “dbcache flush”

@REM Stop the Domino service

NET STOP “Lotus Domino Server (LotusDominoData)”

@REM PAUSE 5 MINUTES TO GIVE TIME FOR THE DOMINO TASKS TO SHUTDOWN PROPERLY

TIMEOUT 300

@REM run nsd kill to terminate any tasks that haven’t shut down

D:\lotus\domino\nsd.exe -kill

@REM The following line works on Windows NT/2000/2003

shutdown /r /f /t 0 /d P:4:1

@REM Switches for the shutdown.exe (NT/2000/2003)

@REM /r: Use this switch to restart the computer instead of fully shutting it down.

@REM /f: force applications to quit

@REM /t 0 - means wait 0 seconds to execute the command (default is 30 if no switch)

@REM /d[p:xx:yy] indicates that this is a planned shutdown and gives the reason codes

@REM /d p:4:1 indicates “Application: Maintenance (Planned)”

END CODE

If you only want to restart Domino, you can probably run this code in the batch file instead of the above.

BEGIN CODE

@REM drop users and cache - where D:\lotus\domino is your program directory

D:

cd \lotus\domino

NSERVER.EXE -c “drop all”

NSERVER.EXE -c “dbcache flush”

NSERVER.EXE -c “restart server”

END CODE

Please see my previous post here for full maintenance job.

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/9acfd776a202cf0d852573360030f83a?OpenDocument&Highlight=0,killingsworth

Also, see Bastian Wieczorek’s OpenNTF project here.

http://www.openntf.org/projects/pmt.nsf/0/9A7B998D7BC8F92586257117005505C6

Subject: Best way to schedule a daily server restart

I’d suggest fixing whatever other problem it is that you’re having instead restarting the server daily.

If the problem you have is a bug within Domino, you’re doing the community a disservice by not getting it fixed.

If it’s corrupt data, bad design, or something else, you are just delaying the inevitable.

Subject: RE: Best way to schedule a daily server restart

@AJAY : Thnaks. I’ll have a look.

@Peter :

“you’re doing the community a disservice by not getting it fixed”

You certainly already heard about http memory leak on windows. The http task can’t get back the memory took. It’s a common issue but not yet fixed by IBM.

Subject: RE: Best way to schedule a daily server restart

Julien - you posted to “all releases”, but I can assure you that I have no memory issues with my 6.5.5 FP2 HTTP process.

I have a server that has been up and running for 59 days without restart. It runs Domino, IIS, and a bunch of .NET stuff all together and is rock solid.

Now, could there be a memory issue with the version you’re running, sure - but you didn’t mention that version in your post.

Subject: RE: Best way to schedule a daily server restart

My domino release is 6.53. I upgrate to V7.0.2 this weekend. I hope you’re right concerning this http memory issue.

Thanks for your help.

Julien

Subject: RE: Best way to schedule a daily server restart

Just look at the number of items in the fix list:

http AND memory

http://www-10.lotus.com/ldd/r5fixlist.nsf/Search?SearchView&Query=http%20AND%20memory&SearchOrder=0&Start=1&Count=100