Познакомьтесь с пентестом веб-приложений на практике в нашем новом бесплатном курсе
у него нет локальной реплики (нет столько свободного места) и про дни я не совсем понялв свойствах репликации поставить галочку - удалить через столько-то дней, только заменить 90 на например 500 дней![]()
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim nextdoc As NotesDocument
Dim dtolddate As New NotesDateTime(Today)
Dim servername As String
Dim amounttoadjust As Integer
'NEED TO SET THESE VARIABLES
'Set variable containing server name
serverName = "ARC/DOM/ORG" 'Set to "" for local client
'Set variable parameter to how old the docs should be, here -60 means 60 day old
AmountToAdjust=-365
Call dtOldDate.AdjustDay(AmountToAdjust)
Dim dbdir As New NotesDbDirectory(serverName)
Set db = dbdir.GetFirstDatabase(user.nsf)
'Skip databases which you don't have access to
On Error 4060 Goto ErrorHandling
On Error 4000 Goto ErrorHandling
While Not db Is Nothing
' You can optionally specify a specific directory to act on.
' This will act on databases and subdirectories below the specified directory
' Note: It is critical to include the trailing backslash (directory decimeter)
' The example below acts on the Mail directory.
' If Instr(db.FilePath,"mail\") Then 'Unremark this line to act on specified directory
Call db.Open("", "")
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument
While Not doc Is Nothing
Set nextDoc = dc.GetNextDocument(doc)
If doc.Created < dtOldDate.lslocaltime Then
Call doc.Remove(True)
End If
Set doc = nextDoc
Set nextDoc = Nothing
Wend
' End If 'Unremark this line to act on specified directory
GetNextDb:
Set db = dbdir.GetNextDatabase
Wend
Exit Sub
ErrorHandling:
'If the code reaches here then
' either the user does not have access rights to the database (error 4060)
' or they don't have the rights to delete documents (error 4000)
Resume GetNextDb
Локальная реплика и не нужна, да и репликация тут как бы сбоку. Просто в базе, где эта галка установлена, документы, не изменявшиеся в течение указанного кол-ва дней, будут удалены.у него нет локальной реплики (нет столько свободного места) и про дни я не совсем понял
в свойствах реплики есть только пункт Remove documents not modified in the last (days). Это он?в свойствах репликации поставить галочку - удалить через столько-то дней, только заменить 90 на например 500 дней![]()
в свойствах реплики есть только пункт Remove documents not modified in the last (days). Это он?
P.S. не могу попасть в свойства репликации. Долго думает и открывает только верхнюю часть, где Заголовок, на каком сервере, Имя файла и его тип...и все((( ошибка B-tree structure is invalid
удаление будет ежедневное и её рост фактически будет остановленУдаление док-тов не приведет к уменьшению размера базы, все равно потом компактить надо.
Можно попробовать создать реплику этой базы (локально или на др. сервере) - иногда помогало при превышении размеров.
а чтом подробнее.. у Вас все базы на основании какого то шаблона почтового.. вот в нем (в шаблоне) создаете вид с выборкой какую Вам нуно.. например:можно поподробнее и код агента?
SELECT @IsNotMember("A"; ExcludeFromView) & IsMailStationery != 1 & Form != "Group" & Form != "Person"&@Year(@If(DeliveredDate != ""; DeliveredDate; PostedDate != ""; PostedDate; @Created))<2015
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim arcdb As NotesDatabase
Dim vie As NotesView
Dim dc As NotesDocumentCollection
Dim vieEc As NotesViewEntryCollection
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim folder As variant
Dim FSO As Variant
Dim nameOw As NotesName
Dim prof As NotesDocument
Dim entdc As NotesViewEntryCollection
Dim ent As NotesViewEntry
'*********************************
'* список пропускаемых
'*********************************
Dim spisok (10) As String ' список кого не обрезаем commonname
spisok(0) = ""
spisok(1) = ""
spisok(2) = ""
spisok(3) = ""
spisok(4) = ""
spisok(5) = ""
spisok(6) = ""
spisok(7) = ""
spisok(8) = ""
spisok(9) = ""
Set FSO = CreateObject("Scripting.FileSystemObject")
Set folder = FSO.GetFolder("z:\")
Set db = s.Currentdatabase
Set doc = db.Createdocument()
doc.form = "CleanOld"
Set rtitem = doc.Createrichtextitem("Body")
Forall fil In folder.Files ' перебираем все файлы в папке FolderPath
' Print fil.path
If FSO.GetExtensionName(fil.path)="nsf" Then
If Left(fil.name,2)="a_" Then
Print fil.name
' Print FSO.GetExtensionName(fil.path)
Call rtitem.Appendtext(fil.name)
Call rtitem.Addtab(1)
Set arcdb = s.Getdatabase("ezop", "archive/"+fil.name,false)
If Not arcdb Is Nothing Then
Call rtitem.Addtab(1)
Call rtitem.Appendtext(arcdb.Size)
Set prof = arcDB.Getprofiledocument("CalendarProfile")
If Not prof Is Nothing Then
Call rtitem.Addtab(1)
Set nameow = s.Createname(prof.Getitemvalue("Owner")(0))
If IsNull(ArrayGetIndex(spisok, nameOw.Common, 5 )) Then
Call rtitem.Appendtext(nameow.Common)
Set vie = arcDB.Getview("CleanOld")
If Not vie Is Nothing Then
Call rtitem.Addtab(1)
Call rtitem.Appendtext(vie.Allentries.Count)
' Dim size As Long
' size = 0
' Set entdc = vie.Allentries
' Set ent = entdc.Getfirstentry()
' Do Until ent Is Nothing
' If ent.Isdocument Then
' size = size+ent.Document.Size/1024
' End If
' Set ent = entdc.Getnextentry(ent)
' Loop
' Call rtitem.Addtab(1)
' Call rtitem.Appendtext(size)
Call vie.Allentries.Removeall(false)
'arcdb.Undeleteexpiretime =0
Else
Call rtitem.Addtab(2)
End If
Else
Call rtitem.Appendtext("Пропускаем - в списке")
End If
Else
Call rtitem.Addtab(4)
End If
Else
Call rtitem.Addtab(3)
End If
Call rtitem.Addnewline(1, True)
End If
End If
End ForAll
Call doc.Save(true, false)
End Sub
у Вас все базы на основании какого то шаблона почтового.. вот в нем (в шаблоне) создаете вид с выборкой какую Вам нуно.. например:
в каждой базе по виду фактически - дасоздать вид для тысячи баз
может быть.. но это нужно на каждой базе персонально идти и настраивать.. если через шаблон накатывать - не возможности выбора - кому резать, а кому нет..Настройки репликации дешевле
ИМЕННО))создаём ОДИН агент в ОДНОЙ базе, который ночью проходится по тысячам баз и если надо и чистит и удаляет и компактит и т.д.
Обучение наступательной кибербезопасности в игровой форме. Начать игру!