Lotus Domino compact the open databases

How can I schedule the activity in the lotus notes in the night so that i will compact all databases including the mail databases in mail/xx.nsf files too if even if it is open. What is the compact command too.?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

From the Domino Administrator Start - Task tool
  1.      From the Domino Administrator click the Server - Status tab.
  2.      Click Server Tasks.
  3.      Open the set of Task tools.
  4.      Click Start.
  5.      In the Start New Task box, select a server task from the list. Select advanced options to specify additional parameters.
  6.      Click Start Task.
In the NOTES.INI file
Many tasks run, by default, at specific times. You can schedule additional tasks to run by editing one of these settings in the NOTES.INI file:
ServerTasks starts tasks automatically every time the server starts up
ServerTasksAt starts tasks at a specified time
In a Program document
To run a task on a server at a regularly scheduled time or at server startup, create a Program document in the Domino Directory. You can also use a Program document to run a UNIX shell script or program, or an API program.
If you create a UNIX shell script or API program, you can use any of these characters for the name: A - Z, 0 - 9, & - . _ ' / (ampersand, dash, period, space, underscore, apostrophe, forward slash). Do not use \ (backslash) or any other characters because this can cause unexpected results.
  1.      From the Domino Administrator, open the Domino Directory. Go to the Servers view, and open the Server document.
  2.      Choose Create - Server - Program.
  3.      On the Basics tab, TYPE       load Compact

Then type fill some another filelds.
Then save and close.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Syntax: Load programname
Description: Loads and starts a specified server task or program on the server. You can start a server add-in program or one that takes a command line for additional data, such as a backup program. The program you run must be on the server's search path.
Use the Load command to run a program until it completes or, if the program runs continually, until you stop the server. Where applicable, you can include arguments that determine how the program runs.
Note  Most server commands support the arguments "-?" and "/?" to display online help. For example, you could enter one of these to obtain help for the server command Load Compact:
Load Compact -?
Load Compact /?
Load Fixup -- Loads and runs the Fixup server task.
Load Object Info OBJECT.NSF -- Loads and runs the Shared Mail Manager and passes along arguments that execute the Info task.
To load a task from the Domino Administrator
You can load a task directly from the Server - Status tab in the Domino Administrator.
  1.      From the Domino Administrator, click the Server - Status tab.
  2.      If necessary, click Tools to display the tool bar, and then click Task - Start.
  3.      Under "Start new server tasks," select the task you want to load.
  4.      (Optional) Uncheck "Show advanced options" if you do not want to specify advanced options. The box is checked by default for tasks which do have additional options.
  5.      Click OK.
Use this method to compact many databases on a server. You can continue using the Domino Administrator during compacting.
  1.      From the Domino Administrator, on the Server pane on the left, select the server on which to run Compact. To expand the pane, click the servers icon.
  2.      Click the Server - Status tab.
  3.      In the Task pane on the right, click Task - Start.
  4.      Select Compactor.
  5.      Do one of the following:
To run Compact with options (to control how Compact runs), click "Show advanced options," click Start Task, select options, and then click OK.
To run Compact without options, click Start Task.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Here is an example program document you can use. Make sure the Notes directory is in your system PATH.

Program name: $COMPACT.EXE
Command line: -S 5
Server to run on: ServerName/Domain
Comments: Compact databases with more than 5 percent whitespace.

Enabled/disabled: ENABLED
Run at times: 10:10 PM each day
Repeat interval of: 0 minutes
Days of week: Wed, Sat

In order to schedule a compact task you should create a Program document in NAB:

Open Domino Administrator (or server's names.nsf) > Configurations > Servers > Programs > Add Program

Program name:
Command line:
    "SubfolderOfData\Production\db.nsf" [compact optional arguments]

Set other fields similar to this:
Run at times:      
     02:00 each day
Repeat interval of:      
     0 minutes
Days of week:      
     Sun, Mon, Tue, Wed, Thu, Fri, Sat

To check out the compact command in detail go here:
Sjef BosmanGroupware ConsultantCommented:
Definitely a Program document. It does what you want in 99.9% of all cases.
jobby1Author Commented:
Will it corrupt the database?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.