Translation

Ads

Granjuxx
Professional IT services. Special offers for small companies Websites.
Hostnet
Hosting starting at R$9,90. Free domains. 30 days free trial.


Place your ad here.

Public audience report XHTML valid

Home

Social

A batch file to back up all active state BlackBerry databases PDF Print
User Rating: / 0
PoorBest 
Written by Bruno Grange   
Wednesday, 03 September 2008 02:05

Are you maintaining a BlackBerry Enterprise Server on one of your Lotus Domino servers with a few hundred BlackBerry users? Do you have a lot of orphan state databases due to improper adding or removing of users? Do you wish you had a program that could automatically back up active state BlackBerry databases in a folder first, so you can perform a one-time clearing of the "BESState" data folder without the fear of removing active state databases?

If any of the above is on your wish list, then this LotusScript agent is for you. Once it is executed in the BlackBerry User Profiles database, it will create a DOS batch file entitled "C:backup_state.bat" that will allow you to copy all active state BlackBerry databases to a temporary folder called: "C:Backup."

All you need to do is hit "Ctrl+A" and then hit the "Delete" key to clear the databases in the "BESState" folder. Later on, move those active state databases from the "C:backup" folder back to their original location and you're done!

  
Remarks: OS-level NSF files copy is same as creating
database replicas.


Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim strSearchFormula As String
Dim docCollection As
NotesDocumentCollection

"/***Search for all profile documents with a
ACTIVE state database
***/ Set db = session.CurrentDatabase strSearchFormula =
| Form = "Account" & Deleted != "1" |
Set docCollection =
db.Search(strSearchFormula, Nothing,0)

'/***Prepare the file handle for creating the BATCH file
***/ Dim hFileNum As Integer strFileName=
"C:backup_state.bat" 'Creating a batch file hFileNum =
Freefile() Open strFileName For Output As hFileNum

'/***Get the State database filepath for each
profile documents in the collection
***/ If docCollection.Count <> 0
Then For i=1
To docCollection.Count Set doc=docCollection.GetNthDocument(i)
strStateDBFilePath = doc.rtStateDBLink(0)

'/***Format the string for the DOS copy command
***/ strFormatString = |copy | + |"| +
strStateDBFilePath +|"| + " c:backup"
'Write formatted string to output file
Print #hFileNum, strFormatString
Next
End If

Close hFileNum
End Sub
Related Articles:
 

Add comment


Security code
Refresh