Home > Domino Tips > Developer > A batch file to back up all active-state BlackBerry databases
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

A batch file to back up all active-state BlackBerry databases


Teck Lung Ng
09.28.2006
Rating: -2.23- (out of 5)


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


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

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Teck Lung Ng. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Mobile and Wireless Development for Lotus Notes Domino
Approve Lotus Notes documents using a BlackBerry mobile device
Top 10 Lotus Notes Domino programming and development tips of 2007
A bevy of Notes/Domino development tips
Wireless Integration Development Learning Guide
A smorgasbord of Notes/Domino development tips
Top 10 Domino developer tips of 2005
Berry, berry bizarre -- BlackBerry sues Cranberry
BlackBerry maker denied appeal
Checklist: Mobile/wireless deployment issues
Competitors to RIM step up but find it hard to topple giant

Mobile Devices
Lotus makes mobile partnerships and Notes Traveler top priorities
Lotus Notes/Domino and mobile device management
An introduction to iNotes for Lotus Notes/Domino 8.5
Approve Lotus Notes documents using a BlackBerry mobile device
SaaS and collaboration set the stage at Lotusphere
Collaboration on the run with Lotus Notes and Domino
Solving your Lotus Notes Domino and BlackBerry problems
Install Lotus Traveler for Windows Mobile device synchronization
Exploring Lotus Notes Domino 8.0.1 and beyond
Configuring Lotus Sametime on a Blackberry mobile device

LotusScript
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts