Wednesday, November 22, 2006

Single user backup script for Lotus Notes.

Here is a script I created to backup a users profile within Lotus Notes. It's a quick and dirty but you should get the idea.

Save this into a batch (.bat extension) file. Make sure the user can utilize reg.exe. By default it is a part of Windows XP and 2000.

I suggest running something like this at the system startup. This will avoid any corruption that may happen from the user opening notes.

I have a "replace.vbs" that updates the notes.ini with the correct install location (in case you are moving to a new box). I will post it later. *Update: You can find the replace.vbs here Single user backup script for Lotus Notes Part 2.

@ECHO OFF

REM This creates the C:\NotesBackup\data directory
MD C:\NotesBackup\data\

REM Takes us to the root of C:\
c:
cd\

REM Queries registry for the lotus notes key.
REM Determines where the files we need to backup are located.
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bdata\*.ID" C:\NotesBackup\data\ /Y /D
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bdata\notes.ini" C:\NotesBackup\data\ /Y /D
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bnotes.ini" C:\NotesBackup\ /Y /D
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bdata\Desktop6.ndk" C:\NotesBackup\data\ /Y /D
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bdata\bookmark.nsf" C:\NotesBackup\data\ /Y /D
FOR /F "tokens=2* delims= " %%A IN ('reg query HKLM\Software\lotus\notes /v Path') DO xcopy "%%Bdata\names.nsf" C:\NotesBackup\data\ /Y /D\

REM I will post "replace.vbs" later. This vbs allows us to update the notes.ini with the proper location.
REM wscript h:\replace.vbs

REM This makes another folder.
MD g:\notesbackup\

REM Copies c:\Notesbackup to another location.
xcopy c:\Notesbackup\*.* g:\Notesbackup /Y /E

1 comment:

maximillian_x said...

I may actually need this soon! My new job location is HEAVY into Notes...thanks for the great info!

Rob

Disclaimer

All data and information provided on this site is for informational purposes only. adminbromo.blogspot.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.