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