ShowTable of Contents
Context of use
To leverage the power of multi-threading with a Domino server tasks, you have to load the same task several times. But then you have to divide the work between each of them.
Example: I would like to do a quick Fixup on 200 mail databases. That will take 4 less time if I load 4 Fixup tasks, and affect a quarter of the databases to each of them. The problem has always been to build these 4 databases lists in indirect files (IND).
This simple script will do the job in one second.
Prerequisite
The script is written with Windows PowerShell, so restricted to Windows platform, but not old Windows server.
Get it in one minute
-
Just open a Windows PowerShell command.
You may need to open it in ADMIN mode, otherwise you won't have enough rights to write the files.
-
Look at the script and correct the parameters
-
Paste the script and run.
-
Done. The IND files are ready for use in the Data directory.
The script:
$DATA = "d:\ibm\domino\data";$DIRECTORY = "mail";$GROUPSNB = 4 ;$files = Get-ChildItem "$DATA\$directory\*.nsf" -Name; $count = $files.count; $nb = [math]::ceiling($count / $GROUPSNB) ;$groupi = 1 ;$results = @(); $i = 0 ;foreach ($filename in $files){$results += "$directory\$filename";$i += 1 ;if ( $i -eq $nb ) { $results | Out-File "$DATA\$DIRECTORY$groupi.ind" -Encoding "default"; $i = 0 ; $groupi += 1 ; $results = @();};}; if ( $results -ne "" ) { $results | Out-File "$DATA\$DIRECTORY$groupi.ind" -Encoding "default"; }; Write-Host "succeed: $groupi files have been created, listing $count databases." ; Write-Host "The files are in the directory: $DATA, they are named '$DIRECTORY`X.ind' , where X is from 1 to $GROUPSNB." ;
The script takes 3 parameters :
$DATA = Domino DATA Directory
$DIRECTORY = subdirectory under $DATA, usually "mail" directory, but could be "archive" or any directory to process
$GROUPSNB = how many groups do you want to divide the list in ? usually you can load as many tasks as you have CPU cores, or even twice. So if you have 2 CPUs, build 4 ind files, and run 4 tasks like Fixup, Compact..
Use the .IND files
The IND files are waiting for you in the Domino DATA Directory, you can just call: