Domino Server runs multiple compact tasks on a Tuesday at 12 midday

This has been reported a number of times, and it seems like the cause is known - a Policy Archive Setting document. In the Policy Archive Document, one can specify either client-side or server-side archiving. Even though the Archive Settings document has “Server” selected in the “Archiving will be performed on:” section, a compact task is started on the server at 12 noon on a Tuesday for each client connected, and it runs against each active client’s mail database.

There is a technote on this:

http://www-1.ibm.com/support/docview.wss?uid=swg21105286

And a helpful post by Jerry Gassie:

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/54b1d631ec220bb685256e3d0065c6de?OpenDocument&Highlight=0,compact,tuesday

The technote has a work around - to ensure “Enable client based scheduled archiving” is unchecked on the scheduled tab of the archive policy document (to access this tab you have to momentarily enable client archiving), and upgrade beyond 6.0.1CF1.

I have both clients and server running at 6.5.1, and have employed the work-around, but I still get those confounded compact tasks sprouting like a wave of B52s blanket bombing my server on a Tuesday.

Does anybody have any ideas?

Subject: Domino Server runs multiple compact tasks on a Tuesday at 12 midday

Hi Mike,Got the same issue since about 1 year at one of our customers site. I opened a SPR with IBM and looked for a solution. They never gave me a clear answer but there may be one solution. It seems that we would need to run around on the workstations and delete the policies in the private address books of the clients so that they get a new clean copy from the server once they connect again. Didn’t try it yet but may work correctly. Problem is that you can’t see the result before the following Tuesday 12PM and check if the compact task is still runing for the users that have been “fixed”. Keep me informed if it helped.

Subject: RE: Domino Server runs multiple compact tasks on a Tuesday at 12 midday

Fascinating Marc,Hidden away in the user’s local address books are a host of policy documents - visible on view ($Policies). I’ll knock up an agent for everybody to run to remove all these documents, and let you know how I get on.

Thanks for your posting.

Subject: Domino Server runs multiple compact tasks on a Tuesday at 12 midday - A FIX THAT WORKS!!

By jove I think I’ve fixed it!!The problem wasn’t local policy documents, but the problem was in the local names and address book - Program documents found in ($Programs).

It seems that each time a policy document is applied to the client, an associated program document is created, and these do not get cleared down. To overcome this, you can visit each client, open the local name and address book, hold down Shift+Ctrl whilst opening the “View\GoTo” option, and select view ($Programs), then delete all documents that run at 12:00 on a tuesday (3). Alternatively, copy the following code into the PostOpen event of the Database Script of your EMail template (Mail6.ntf - open in design, goto Other\Databaes Resource), then after the 1am designer task runs, the code will be present in each mail file to be run by each client on open. Read the header detail for more info on the code.

The code will EMail notification of what it’s done. Some of my users had upwards of 91 program documents, hence the proliferation of compact tasks on a Tuesday midday. Who’s responsible for QAing this product!!

Good luck

%REM Mike Hayman - mhayman@bpms.co.uk - 7th April 2004

CODE FOR LOCAL PROGRAM DOCUMENT CLEAR DOWN

This code finds and removes and Program documents from the local Address Book that initiate a compact task at noon on a Tuesday

When a policy is applied to a user, and that policy has a local archive requirement, a program document is created in the local directory.

These program documents are not always cleared down when the policies are changed.

You can see the programs defined locally in view ($Programs) in the local Address Book

This code can be put into the PostOpen event of Database Script in a user database such as the Mail database.

It can be removed after a period (say a month) as it only needs to be run once per user.

This code will only run once; controlled by a flag in a profile document within the local Address Book

Set constant c_bNotify to true to send an email to name in constant c_sSendTo

Email notification states the number of program documents deleted.

If Notify flag set, then will also send notification of any errors encountered.

Set constant bRunForAllUsers to false in order to control the users that run the code by specifying them in arrsUser

%END REM

Const c_bNotify = True

Const c_bRunForAllUsers = False

Const c_sSelect = { Type ="Program" & Form = "Program" & Program = "Compact" & Schedule=[12:00:00] & WeekDays = "3" }

Const c_sSendTo = "Administrators"

Const c_sProfileName = "DatabaseProfile"

Const c_sProfileItem = "ProgramRemovedDate"



Dim arrsUser () As String	

Dim sess As New NotesSession

Dim docProfile As NotesDocument

Dim docMail As NotesDocument

Dim sUserName As String

Dim vAddressBooks As Variant

Dim dbAddressBook As NotesDatabase

Dim dcProgram As NotesDocumentCollection

Dim iProgram As Integer

Dim sErrorMessage As String





On Error Goto ErrorHandle



' Only run for specific users

If Not c_bRunForAllUsers Then

	Redim arrsUser (0 To 5)

	arrsUser(0) = "User1"

	arrsUser(1) = "User2"

	arrsUser(2) = "User3"

	arrsUser(3) = "User4"

	arrsUser(4) = "User5"

	arrsUser(5) = "User6"

	sUserName = sess.CommonUserName

	If Isnull ( Arraygetindex ( arrsUser, sUserName)) Then Exit Sub

End If ' Do not run for all users



' Get local address book	

vAddressBooks = sess.AddressBooks

Forall f_Db In vAddressBooks

	If f_Db.IsPrivateAddressBook Then

		Set dbAddressBook = f_Db

		Exit Forall

	End If

End Forall



If Not dbAddressBook Is Nothing Then

	If Not dbAddressBook.IsOpen Then dbAddressBook.Open "", ""

	' Check that have not run before

	Set docProfile = dbAddressBook.GetProfileDocument ( c_sProfileName )

	

	If Not docProfile.HasItem ( c_sProfileItem ) Then

		' Run selection

		Set dcProgram = dbAddressBook.Search (c_sSelect , Nothing, 0)

		If dcProgram.Count > 0 Then

			Print "Removing " + Cstr ( dcProgram.Count ) + " Program documents..."

			iProgram = dcProgram.Count

			dcProgram.RemoveAll True

			If c_bNotify Then

				Print "Sending notification of deletion of " + Cstr (iProgram) + " program documents to " + c_sSendTo + "..."

				Set docMail = dbAddressBook.CreateDocument

				docMail.Subject = "PAB - " + sUserName + ": " + Cstr ( iProgram ) + " Program documents deleted"

				docMail.Send False, c_sSendTo

			End If ' Notify administrator

		End If ' There are archive policy documents

		docProfile.ReplaceItemValue  c_sProfileItem, Now() 

		docProfile.Save True, False, True

	End If ' Have not run before

End If ' Address book found

Goto EndOfSub

ErrorHandle:

sErrorMessage = |** Error | + Cstr (Err) + |: "| + Error$  + |" raised at line | + Cstr (Erl) + | when removing Program Documents for | + sUserName

If c_bNotify Then

	Print "Sending notification to " + c_sSendTo + ". " + sErrorMessage

	Set docMail = dbAddressBook.CreateDocument

	docMail.Subject = "PAB - " + sUserName + ":  " + sErrorMessage

	docMail.Send False, c_sSendTo

Else

	Print sErrorMessage

End If ' Notify administrator

Resume EndOfSub

EndOfSub:

%REM Mike Hayman - mhayman@bpms.co.uk - 7th April 2004

CODE FOR LOCAL PROGRAM DOCUMENT CLEAR DOWN

%END REM

Subject: RE: Domino Server runs multiple compact tasks on a Tuesday at 12 midday - A FIX THAT WORKS!!

Hi Mike,Thanks a lot for sharing the solution. Sure it will help a lot of people.

Kind regards,

Marc

Subject: RE: Domino Server runs multiple compact tasks on a Tuesday at 12 midday - A FIX THAT WORKS!!

This script works great! Thank you so much. My server didn’t crash today!

Just remember to restart the domino services for the script to kick in, and also know that once the client logs into the lotus, that the client may get a pop up box(Execution Security Alert) and they have to select “start trusting the signer to execute this action” I’ve seen some clients get this pop up 4 or 5 times…It’s asking to trust for different actions each time.