DB Compactor - Can it be scheduled to stop

We have the Task “DB Compactor” scheduled to start running every evening at 7pm. Is there a way to have this task scheduled to shut off by a certain time … say (7am)?

In the Server config. Doc., under programs is where I have added this task to be scheduled …“Start Time” of 7pm every evening. I don’t understand why Domino wouldn’t put a “Stop Time” in this scheduled area???

thank you

Subject: DB Compactor - Can it be scheduled to stop

Well I’ve never tried this but it should work in theory…

Create a Program Doc to run at the desired time,

program name: COMPACT

command line: quit

and you’re right, it would be nice if there was a duration field like they have for scheduled replication tasks.

Subject: RE: DB Compactor - Can it be scheduled to stop

Well, I added this but it did not work.

Command = Compact

Option = Quit

Server = name of Domino Server

I did a test and scheduled this to take place 5 minutes after the compact started, but it did not shut down the instance.

Subject: RE: DB Compactor - Can it be scheduled to stop

Jack Dausman has a great write-up about getting your compact tasks under control. I haven’t implemented his program, but I do use manually-created Indirect Files to compact certain items each day.

Jack Dausman: Secrets of the Administration Guild #9: Targeted Compacting

Chris Whisonant

http://cwhisonant.blogspot.com

Subject: RE: DB Compactor - Can it be scheduled to stop

try it this way instead:

Program name: nserver

Command line: -c “tell compact q”

I just tested it and it worked fine. This command is for Windows Platform.

Subject: RE: DB Compactor - Can it be scheduled to stop

Oh Yeah, That worked.Thank you very much Paul, muco appreciated.

Subject: DB Compactor - Can it be scheduled to stop

Not directly.

You may want to compact just a few each night to ensure that all get compacted each week. Do one folder on Monday, another Tuesday, …

I did a quick test on my test server and confirmed that this will stop it:

TELL COMPACT QUIT

The console shows:

01/17/2007 09:30:27 AM Error compacting AA.nsf: Operation stopped at your request

01/17/2007 09:30:27 AM Database compactor process shutdown

(Presumably compact ends cleanly without leaving inconsistencies in the database.)

Fortunately, I know a way to schedule a server command – code it into the following agent. You could even enhance the agent to read commands from some central config database to add flexibility to it. If so, post it back to this forum.

Basically the agent has one line of code which tells the NSERVER task to run a command. Use “NSERVER” on Windows servers – something else on other platforms. I don’t remember ever trying the second approach shown in the comments.

Here is the code:

Sub Initialize

Print "sched agent to start STATS and HTTP"



taskId% = Shell ( "nserver.exe -c "+Chr(34)+"sh tasks"+Chr(34) )



taskId% = Shell ( "nserver.exe -c "+Chr(34)+"load stats"+Chr(34) )



taskId% = Shell ( "nserver.exe -c "+Chr(34)+"l http"+Chr(34) )

%REM

— another way to do the same thing —

http://www-10.lotus.com/ldd/nd6forum.nsf/0/a0981a4e9add646285256d81005ec1ae

Great tip, but it may be better to write it using the new SendConsoleCommand function (so it will also work on non-windows servers):

Call notesSession.SendConsoleCommand( db.server, {Tell Adminp Process Interval})

— another way to do the same thing —

see

http://www.greentechnologist.org/domino/LotusScript/

and

http://www.greentechnologist.org/domino/LotusScript/ConsoleCMD.lss

Send server console commands

ConsoleCMD.lss

This allows a client or server-side script to send console commands to the server. It should read the output but that isn’t reliable. It is good about actually sending the results.

Dim Console As RemoteConsole

Dim Command as String

Dim Msg as String

Set Console = New RemoteConsole(“Server01/Something”)

Results = Console.Exec(“tell http q”)

’ … wait until the httpd stops (and check for it exlicitl)

Result = Console.Exec(“load http”)

%END REM

End Sub