#198974 - 2010-07-12 07:38 AM
modify exmerge.ini for different sites
|
Jimay3677
Fresh Scripter
Registered: 2010-02-17
Posts: 9
Loc: Australia
|
Hi everyone, I have a kixtart login script which aswell as backing up to tape and disk runs exmerge to export mailboxes to folders/files.
I currently have 4 exmerge ini files for each of the 3 sites which has different servername, export locations and time stamps (12 files in total)
How can I make kixtart create a temporary copy of exmerge.ini with the server name etc etc rather than having all the separate files?
It would need to. make a temp copy. set servername, set backup location, timestamp (year) etc, run exmerge and delete the temp file then do it again with a different year etc etc?
Thanks.
|
|
Top
|
|
|
|
#198979 - 2010-07-12 12:40 PM
Re: modify exmerge.ini for different sites
[Re: Mart]
|
Jimay3677
Fresh Scripter
Registered: 2010-02-17
Posts: 9
Loc: Australia
|
Here's what I came up with. Very messy, any idea's how to make the code cleaner?
Copy d:\Backups\EXMERGE.ini d:\Backups\EXMERGE.tmp.ini
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SourceServerName", "BENSMTP")
;==================================
;Exmerge 2007
;==================================
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2007")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2007 00:00:00")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2007 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2008
;==================================
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2008")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2008 00:00:00")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2008 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2009
;==================================
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2009")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2009 00:00:00")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2009 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2010
;==================================
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2010")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2010 00:00:00")
WRITEPROFILESTRING ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2010 23:59:59")
Shell $exmergeexe
del 'd:\Backups\EXMERGE.tmp.ini'
Edited by Mart (2010-07-12 12:55 PM) Edit Reason: Please use code tags when posting code.
|
|
Top
|
|
|
|
#198980 - 2010-07-12 01:01 PM
Re: modify exmerge.ini for different sites
[Re: Jimay3677]
|
Mart
KiX Supporter
   
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
|
The values to write are different for each file so there is not so much cleanup that can be done. Cleaned up the screen output by adding $rc = in front of each Writeprofilestring line. This eliminates all the return codes being displayed on the screen.
Copy "d:\Backups\EXMERGE.ini" "d:\Backups\EXMERGE.tmp.ini"
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SourceServerName", "BENSMTP")
;==================================
;Exmerge 2007
;==================================
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2007")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2007 00:00:00")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2007 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2008
;==================================
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2008")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2008 00:00:00")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2008 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2009
;==================================
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2009")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2009 00:00:00")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2009 23:59:59")
Shell $exmergeexe
;==================================
;Exmerge 2010
;==================================
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "DataDirectoryName", "D:\Backup_temp\exchange\ben\2010")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageStartDate", "01/01/2010 00:00:00")
$rc = WriteProfileString ("d:\Backups\EXMERGE.tmp.ini", "EXMERGE", "SelectMessageEndDate", "12/31/2010 23:59:59")
Shell $exmergeexe
Del 'd:\Backups\EXMERGE.tmp.ini'
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1045 anonymous users online.
|
|
|