Home > Domino Tips > Administrator > Domino > A batch file for Lotus Notes Domino maintenance on Windows Server 2003
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DOMINO

A batch file for Lotus Notes Domino maintenance on Windows Server 2003


Jerry Ober
03.20.2008
Rating: -3.25- (out of 5)


Lotus Notes, Domino, Workplace and WebSphere tips and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Use this batch (.BAT) file in accordance with the Microsoft Windows Task Scheduler to perform maintenance on,
Related resources from SearchDomino.com:
A batch file to back up all active state BlackBerry databases

Lotus Notes Domino Interoperability Reference Center

Lotus Notes Domino Performance Reference Center

and then reboot your Windows 2003 servers that are running Lotus Notes Domino.

You must have the shutdown.exe executable command on the Windows 2003 server and be able to execute it from the script for this reboot to work.

A few additional things to keep in mind when using this batch file:

  • The script will wait for 30 seconds before starting, so that it can be cancelled if needed.
  • Upon using the .BAT file, the Domino service is intermittently stopped.
  • Dates are set up so that log files can be renamed with date and time stamps.
REM Domino shutdown script
@ECHO OFF


REM ping nonexistent IP address and 
wait 30 seconds for a time out request
ECHO Waiting 30 seconds before shutting 
down the Domino Server... 
ECHO Press "<Ctrl>C" to stop shutdown
ECHO.
PING 1.1.1.1 -n 1 -w 30000 >NUL

REM Shut down the Domino Service
net stop "Lotus Domino Server (LotusDominoData)"
ECHO Domino shutdown complete
ECHO.
@echo off


REM Shutdown the Domino SNMP AgentService

REM Setup Todays date to be used as the 
file extension for renamed datbases
for /f "tokens=1,2,3,4* delims=/ " %%i in 
('date /t') do set TDDAY=%%i&set 
TDMM=%%j&set TDDD=%%k&set TDYY=%%l
for /f "tokens=1,2* delims=: " %%i in ('time /t') 
do set TDHH=%%i&set TDMIN=%%j


REM Rename the log file
ECHO Renaming log file ...........Please Wait
ECHO.
rename C:LotusDominoDatalog.nsf 
log%TDYY%%TDMM%%
TDDD%%TDHH%%TDMIN%%.old
ECHO log file has been renamed
ECHO.

REM Rename the domlog file if it exists
ECHO Renaming domlog file ...........Please Wait
ECHO.
If exist C:LotusDominoDatadomlog.nsf rename 
C:LotusDominoDatadomlog.nsf domlog
%TDYY%%TDMM%%TDDD%%TDHH%%TDMIN%%.old
ECHO domlog file has been renamed
ECHO.

REM Delete all ".log" files that are more than 60 days old
ECHO Purging log files ...........Please Wait
ECHO.
REM This will delete all *.old files in the 
Domino Data directory older than 60 days. 
To test it first, use this line:
REM Forfiles -p C:LotusDominoData -s -m 
*.old -d -60  -c "cmd /c Echo 0x22@Path"
REM This will delete all *.old files in the 
Domino Data directory older than 60 days.
Forfiles -p C:LotusDominoData -s -m *.old 
-d -60 -c "cmd /c del @path"
Forfiles -p C:LotusDominoDataIBM_
TECHNICAL_SUPPORT -s -m *.dmp -d 
-60 -c "cmd /c del @path"
Forfiles -p C:LotusDominoDataIBM_TECHNICAL_
SUPPORT -s -m *.log -d -60 -c "cmd /c del @path"
Forfiles -p C:LotusDominoDataIBM_TECHNICAL_
SUPPORT -s -m *.txt -d -60 -c "cmd /c del @path"
Forfiles -p C:LotusDominoDataIBM_TECHNICAL_
SUPPORT -s -m *.zip -d -60 -c "cmd /c del @path"
ECHO Old log files have been removed
ECHO.

REM names.nsf maintenance
ECHO Performing maintenance on names.nsf 
...........Please Wait
ECHO.
REM C:LotusDominonfixup names.nsf
C:LotusDominonupdall names.nsf
C:LotusDominoncompact names.nsf
ECHO names maintenance complete
ECHO.


REM Perform Domino database maintenance on 
entire mail directory
REM ECHO Performing maintenance 
on mail directory ...........Please Wait
REM ECHO.
REM C:LotusDominonfixup 
C:LotusDominoDatamail
REM ECHO.
REM ECHO.
REM C:LotusDominonupdall -R 
C:LotusDominoDatamail
REM ECHO.
REM ECHO.
REM C:LotusDominoncompact 
C:LotusDominoDatamail
REM ECHO.
REM ECHO maintenance complete
REM ECHO.


REM mailbox.box maintenance
ECHO Performing maintenance on mailboxes 
...........Please Wait
ECHO.
If Exist C:LotusDominoDatamail.box  
C:LotusDominonfixup  mail.box
If Exist C:LotusDominoDatamail1.box 
C:LotusDominonfixup  mail1.box
If Exist C:LotusDominoDatamail2.box 
C:LotusDominonfixup mail2.box
If Exist C:LotusDominoDatamail3.box 
C:LotusDominonfixup mail3.box
If Exist C:LotusDominoDatamail4.box 
C:LotusDominonfixup mail4.box

If Exist C:LotusDominoDatamail.box  
C:LotusDominonupdall  mail.box
If Exist C:LotusDominoDatamail1.box 
C:LotusDominonupdall  mail1.box
If Exist C:LotusDominoDatamail2.box 
C:LotusDominonupdall  mail2.box
If Exist C:LotusDominoDatamail3.box 
C:LotusDominonupdall  mail3.box
If Exist C:LotusDominoDatamail4.box 
C:LotusDominonupdall  mail4.box

If Exist C:LotusDominoDatamail.box  
C:LotusDominoncompact -c mail.box
If Exist C:LotusDominoDatamail1.box 
C:LotusDominoncompact  mail1.box
If Exist C:LotusDominoDatamail2.box 
C:LotusDominoncompact mail2.box
If Exist C:LotusDominoDatamail3.box 
C:LotusDominoncompact mail3.box
If Exist C:LotusDominoDatamail4.box 
C:LotusDominoncompact mail4.box
ECHO MailBox maintenance complete
ECHO.

echo Run shutdown command.
SHUTDOWN /L /R /T:0

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Jerry Ober. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Lotus Notes Domino Performance
Repair Lotus Domino server 'Cannot write or create file' error
What is slowing down my Domino server?
Move a Lotus Domino server to a new certifier without a reinstall
Top 10 Lotus Notes Domino administration tips of 2007
Lotus Domino Server performance-tuning pointers
Log off idle Lotus Notes users for better Domino Server performance
Slow Domino server performance and failure on agent managers
Top 10 Notes/Domino administration tips of 2006
Two fast and easy Domino Web Access performance tips
Top 10 Domino administration tips of 2005

Domino
Secure Lotus Notes 8 with the Internet password lockout feature
Troubleshoot Lotus Notes Out of Office (OOO) agent error messages
Avoid Lotus Notes Domino email archiving ACL issues with AdminP
Send pop-up admin messages to Lotus Notes users from Domino Server
Protect Lotus Notes from malicious code with the Domino ECL
Update to Exchange Server 2003 Connector for Lotus Notes
Synchronize LinkedIn contacts with Lotus Notes Domino
Eight best practices for running BlackBerry Enterprise Server on Lotus Notes Domino
Setting up Rooms and Resources in Lotus Notes Domino 7
How to correct Lotus Notes public key mismatches in four easy steps

Lotus Notes Domino Interoperability
Fix Lotus Notes 8.0 issues when launching Microsoft Office applications
Lotus Notes and Microsoft SharePoint integration
Running Lotus Notes Domino on Linux
Using Microsoft Outlook with Lotus Domino Server FAQs
Update to Exchange Server 2003 Connector for Lotus Notes
How to install Lotus Notes on Linux CentOS-4
How to install Lotus Domino Server on SUSE Linux
Using Microsoft Outlook with a Lotus Domino server
How to configure DB2 on a single Lotus Domino server
IBM redesigns, renames iSeries for SMBs

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts