Appendix A -- Backup Control File

[Previous] [Next]

This appendix presents the code for the backup control file (SMS\Inboxes\SMSbkup.box\SMSbkup.ctl) used by the SMS Site Backup service when performing a site server backup scheduled through the Backup SMS Site Server database maintenance task. This task can be enabled through the SMS Administrator Console and is discussed at length in Chapter 17.

 # Backup Control File for automated site backup task # Systems Management Server (SMS) version 2.0 with Service Pack 1 # Updated June 16, 1999 # Syntax help for customizing a backup control file is provided at # the end of this file. # If the Site SQL Database is on a different server from the # Metering SQL database, remove the comments from: # -Any tasks that run against the METERING_DB_SERVER. # Also, enable the "Software Metering SQL Server" blocks in the # "*** SQL Data ***" and "*** Registry Keys ***" subsections by # removing or commenting out their #stop and #start lines. # Naming Conventions for Output Files: # # Files created by "file" or "cmd" tasks are copies of original files, # and so and so their names are not modified. # Files created by "reg", "sitedbdump", and "meteringdbdump" tasks # contain new data that requires new file names. # # "Config" files refer to configuration data that a task exports and saves in # the backup. There are 2 types of config data because a SQL server machine # can have both NT and SQL configuration data. # # The file names are built as follows: # -Prefix with "SMSbk" (to indicate file comes from an SMS backup.) # -Add the server type that the data is being backed up from: # "Site" = site server, # "Prov" = site provider server, # "SQL" = site SQL server, # "Meter" = software metering SQL server. # -Add the type of data the file contains: # "Reg" = registry keys, # "DB" = database dump, # "ConfigNT" = NT configuration data, # "ConfigSQL" = SQL server configuration data. # -Add the actual data source. For example: # "master" = SQL server s master database # "NAL" = NAL registry key # -Suffix with extension based on data type: # ".dat" = registry keys and database dumps (ie. raw data) # ".txt" = human readable data # # Samples: # The NAL registry key from the site server would be backed up to: # SMSbkSiteRegNAL.dat # The master database from the site SQL server would be backed up to: # SMSbkSQLDBmaster.dat # [Tokens] # Built in tokens and the values they contain: # # SITE_CODE (3 character code for site) # SITE_SERVER (site server) # SITE_DB_SERVER (site s SQL server) # METERING_DB_SERVER (site s software metering SQL server) # PROVIDER_SERVER (server hosting SMS provider) # SITE_SERVER_ROOT_DIR # (SMS installation s root directory on site server) # SITE_DB_SERVER_ROOT_DIR # (SQL Server installation s root directory on site s SQL server) # METERING_DB_SERVER_ROOT_DIR # (SQL Server installation s root directory on site s software # metering SQL server) # SITE_DB_NAME (site database name on site s SQL server) # METERING_DB_NAME # (software metering database name on site s software metering SQL server) # BACKUP_DEST_DIR # (value of "Export to" field from admin console s "Backup SMS # Site Server" property page) # # The default destination directories allow multiple sites to share the # same export location. # Destination subdirectories and their default locations: # # SITE_SERVER_DEST %BACKUP_DEST_DIR%\%SITE_CODE%\SiteServer\ # SITE_DB_SERVER_DEST %BACKUP_DEST_DIR%\%SITE_CODE%\SiteDBServer\ # METERING_DB_SERVER_DEST %BACKUP_DEST_DIR%\%SITE_CODE%\MeteringDBServer\ # PROVIDER_SERVER_DEST %BACKUP_DEST_DIR%\%SITE_CODE%\ProviderServer\ # # These lines set the default user defined tokens: BACKUP_DESTINATION=%BACKUP_DEST_DIR%\%SITE_CODE% SITE_SERVER_DEST=%BACKUP_DESTINATION%\SiteServer SITE_DB_SERVER_DEST=%BACKUP_DESTINATION%\SiteDBServer METERING_DB_SERVER_DEST=%BACKUP_DESTINATION%\MeteringDBServer PROVIDER_SERVER_DEST=%BACKUP_DESTINATION%\ProviderServer [Stop] # If the site being backed up was not installed with the express setup # option, some of the following services might not be installed. To avoid # spurious errors, comment out any services that are not installed on # the site. service \\%SITE_SERVER%\SMS_SITE_COMPONENT_MANAGER service \\%SITE_SERVER%\SMS_EXECUTIVE service \\%SITE_DB_SERVER%\SMS_SQL_MONITOR service '\\%SITE_SERVER%\Info APS' service '\\%SITE_SERVER%\Info Agent' service '\\%SITE_SERVER%\Info Sentinel' # SMS services that are not being stopped because they don t interfere with # backup include "SMS_LICENSE_SERVER" and "SMS_NT_LOGON_DISCOVERY_AGENT". # They should be left running to support clients while the site is being # backed up. # The SMS Remote Control service provides a backdoor to troubleshoot # problems, and doesn t interfere with backup. It is safer to leave it # running. # WMI (the Windows Management service) can be used by non-SMS processes, and # doesn t interfere with backup. To avoid interrupting operations, it is # better to leave it running. # Stopping or starting the SMS client is NOT recommended in the current # release. Please refer to a KB article for more information. # service 'SMS Client Service' # clientapp launch32.exe # clientapp SMSMon32.exe # clientapp SMSAPM32.exe # Pause to let all writes be flushed to disk. sleep 30 [Tasks] # Clean out the destination directory to so old files don t get mixed up with # the new backup. cmd 'RMDIR /S /Q %BACKUP_DESTINATION%\' # *** Files *** # # Backup is assumed to be running on the site server, and so will be backing # up local site server files. # Backing up the SMS client is NOT recommended in the current release. Please # refer to a KB article for more information. # file %SystemRoot%\MS\SMS %SITE_SERVER_DEST%\SMSClient\ file %SystemRoot%\system32\WBEM %SITE_SERVER_DEST%\WBEM\ file %SITE_SERVER_ROOT_DIR% %SITE_SERVER_DEST%\SMSServer\ # # *** Server Data *** # # Requirements: # -MACHINFO.BAT must be in SMSBKUP.EXE s (SMS_SITE_BACKUP) startup location. # -NT Resource Kit Tools must be in the path or in SMSBKUP.EXE s startup # location. The required tools are: NLTEST.EXE, NOW.EXE, SRVINFO.EXE, # and TLIST.EXE. # -WINMSD.EXE ships with the operating system and is used by MACHINFO.BAT. # -SMS_SITE_BACKUP runs with the site service account, which has # administrative rights on the site server. It also needs to have # administrative rights on the target server(s), and to be able to write # files to the destination location. cmd ECHO %SITE_SERVER_DEST%\ cmd 'MACHINFO.BAT %SITE_SERVER% %SITE_SERVER_DEST%\ SMSbkSiteConfigNT' cmd ECHO %SITE_DB_SERVER_DEST%\ cmd 'MACHINFO.BAT %SITE_DB_SERVER% %SITE_DB_SERVER_DEST%\ SMSbkSQLConfigNT' cmd ECHO %METERING_DB_SERVER_DEST%\ # cmd 'MACHINFO.BAT %METERING_DB_SERVER% %METERING_DB_SERVER_DEST%\ SMSbkMeterConfigNT' # # *** Registry Keys *** # # If the site being backed up was not installed with the express setup # option, some of the following registry keys might not be installed. # To avoid spurious errors, comment out any registry keys that are not # installed on the site. # Site Server reg \\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\MMC %SITE_SERVER_DEST%\SMSbkSiteRegMMC.dat reg \\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\NAL %SITE_SERVER_DEST%\SMSbkSiteRegNAL.dat reg '\\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\Network  Monitor' %SITE_SERVER_DEST%\SMSbkSiteRegNetworkMonitor.dat reg \\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS %SITE_SERVER_DEST%\SMSbkSiteRegSMS.dat reg \\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SNMP_EVENTS %SITE_SERVER_DEST%\SMSbkSiteRegSNMPEvents.dat reg \\%SITE_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM %SITE_SERVER_DEST%\SMSbkSiteRegWBEM.dat reg '\\%SITE_SERVER%\HKEY_LOCAL_MACHINE\SOFTWARE\Seagate Software\ Crystal Info' %SITE_SERVER_DEST%\SMSbkSiteRegCryInfo.dat reg '\\%SITE_SERVER%\HKEY_LOCAL_MACHINE\SOFTWARE\Seagate Software\ Crystal MMC SnapIn' %SITE_SERVER_DEST%\SMSbkSiteRegCryMMC.dat reg '\\%SITE_SERVER%\HKEY_LOCAL_MACHINE\SOFTWARE\Seagate Software\ Seagate Crystal Info for SMS' %SITE_SERVER_DEST%\SMSbkSiteRegCryForSMS.dat # Site SQL Server reg \\%SITE_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer %SITE_DB_SERVER_DEST%\SMSbkSQLRegMSSQLServer.dat reg \\%SITE_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\NAL %SITE_DB_SERVER_DEST%\SMSbkSQLRegNAL.dat reg \\%SITE_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS %SITE_DB_SERVER_DEST%\SMSbkSQLRegSMS.dat reg \\%SITE_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SNMP_EVENTS %SITE_DB_SERVER_DEST%\SMSbkSQLRegSNMPEvents.dat reg \\%SITE_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM %SITE_DB_SERVER_DEST%\SMSbkSQLRegWBEM.dat # Software Metering SQL Server #stop reg \\%METERING_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\ MSSQLServer %METERING_DB_SERVER_DEST%\SMSbkMeterRegMSSQLServer.dat reg \\%METERING_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\NAL %METERING_DB_SERVER_DEST%\SMSbkMeterRegNAL.dat reg \\%METERING_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS %METERING_DB_SERVER_DEST%\SMSbkMeterRegSMS.dat reg \\%METERING_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\ SNMP_EVENTS %METERING_DB_SERVER_DEST%\SMSbkMeterRegSNMPEvents.dat reg \\%METERING_DB_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM %METERING_DB_SERVER_DEST%\SMSbkMeterRegWBEM.dat #start # Presently, the Provider Server is either the Site or Site SQL Server. This # registry key has therefore already been backed up. Backing it up again # here helps ensure future compatibility. reg \\%PROVIDER_SERVER%\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS %PROVIDER_SERVER_DEST%\SMSbkProvRegSMS.dat # # *** SQL Data *** # # Requirements: # -SMSSQLINFO.BAT and the SQL script SMSSQLINFO.SQL must be in SMSBKUP.EXE s # (SMS_SITE_BACKUP) start location. # -The SQL utility ISQL.EXE must be in the path or in SMSBKUP.EXE s # start location. # -SMS_SITE_BACKUP runs with the site service account which has administrative # rights on the site server. This account must also have administrative # rights on the target server(s) and database(s), and write access to # the destination location. # Consider running the following before backup to reduce the risk of a # corrupted backup: # DBCC CHECKDB # DBCC CHECKCATALOG # DBCC NEWALLOC (6.5 only) # DBCC TEXTALLOC (6.5 only) # Site SQL Server cmd 'SMSSQLINFO.BAT %SITE_DB_SERVER% %SITE_DB_NAME% %SITE_DB_SERVER_DEST%\ SMSbkSQLConfigSQL' sitedbdump master %SITE_DB_SERVER_DEST%\SMSbkSQLDBmaster.dat sitedbdump msdb %SITE_DB_SERVER_DEST%\SMSbkSQLDBmsdb.dat sitedbdump model %SITE_DB_SERVER_DEST%\SMSbkSQLDBmodel.dat sitedbdump %SITE_DB_NAME% %SITE_DB_SERVER_DEST%\SMSbkSQLDBsite.dat # Software Metering SQL Server # Always dump metering database if metering is installed. meteringdbdump %METERING_DB_NAME% %METERING_DB_SERVER_DEST%\SMSbkMeterDBmeter.dat # By default, the metering database is installed on the site SQL server. In # that case, all the SQL configuration information has already been # collected.If the metering database is on a separate SQL server, enable # the following block. #stop cmd 'SMSSQLINFO.BAT %METERING_DB_SERVER% %METERING_DB_NAME% %METERING_DB_SERVER_DEST%\ SMSbkMeterConfigSQL' meteringdbdump master %METERING_DB_SERVER_DEST%\SMSbkMeterDBmaster.dat meteringdbdump msdb %METERING_DB_SERVER_DEST%\SMSbkMeterDBmsdb.dat meteringdbdump model %METERING_DB_SERVER_DEST%\SMSbkMeterDBmodel.dat #start # These log files should be backed up after the SQL related tasks have run, # to record any SQL server errors that might effect the integrity of backup. file %SITE_DB_SERVER_ROOT_DIR%\LOG %SITE_DB_SERVER_DEST%\SQLLog\ # file %METERING_DB_SERVER_ROOT_DIR%\LOG %METERING_DB_SERVER_DEST%\SQLLog\ # # Create a record of the whole backup cycle # # This takes a snapshot of the backup log (if backup logging is enabled.) # It should be used to verify the quality and completeness of a backup # before restoring. Be sure to enable SMS logging for SMS_SITE_BACKUP # so these files can be saved with the backup, or there won t be any way # to verify the backup before restoring a failed site. file %SITE_SERVER_ROOT_DIR%\Logs\smsbkup.log %BACKUP_DESTINATION%\ file %SITE_SERVER_ROOT_DIR%\Logs\smsbkup.lo_ %BACKUP_DESTINATION%\ [Start] # If the site being backed up was not installed with the express setup # option, some of the following services might not be installed. To avoid # spurious errors, comment out any services that are not installed on the # site. service \\%SITE_DB_SERVER%\SMS_SQL_MONITOR service \\%SITE_SERVER%\SMS_EXECUTIVE service \\%SITE_SERVER%\SMS_SITE_COMPONENT_MANAGER service '\\%SITE_SERVER%\Info APS' service '\\%SITE_SERVER%\Info Agent' service '\\%SITE_SERVER%\Info Sentinel' # Stopping or starting the SMS client is NOT recommended in the current # release. Please refer to a KB article for more information. # service 'SMS Client Service' # clientapp %SystemRoot%\MS\SMS\core\bin\launch32.exe # "SMS Client Service" and launch32.exe will start SMSAPM32.exe and # automatically, so there is no need to manually start them. # SYNTAX HELP # # Most of the syntax is used by working tasks in the default backup control # file, so if unsure about usage, find a line, make a copy, and edit it. # Using White space: # A space character separates each of the 3 sections of a task (that is, the # task type, source, and destination.) Use the back quote character, " ' ", # to quote a source or destination that contains spaces. # For example, the following two lines will cause errors: # file C:\Program Files\Common Files %BACKUP_DESTINATION% # file C:\'Program Files'\'Common Files' %BACKUP_DESTINATION% # Use this line instead: # file 'C:\Program Files\Common Files' %BACKUP_DESTINATION% # Destination Syntax Rules: # All tasks will implicitly create the directory where their destination # component goes, if it doesn t already exist. Note that the "cmd" task # creates any path needed for its destination component, (the third # component on the line), and NOT any directories used by the command line # itself (the second component on the line.) For example, "cmd" tasks # won t create a destination directory just because the BACKUP_DEST_DIR # token is used in the task s source section. # To create a directory that must exist for a later "cmd" task, use either # of the following syntaxes: # cmd ECHO %BACKUP_DEST_DIR%\NewDir\ # cmd 'mkdir %BACKUP_DEST_DIR%\NewDir\' # A destination need not be specified for "cmd" tasks, but is required by # every other task type. # "reg", "sitedbdump", and "meteringdbdump" tasks require a file name to be # specified as a destination. # "file" tasks require a directory name to be specified as a destination. # Source files are copied into the dest directory. Source directories # contents, but not the directory itself, are copied into the dest # directory. For example, the following task: # file c:\winnt c:\saved_winnt # creates a directory "c:\saved_winnt" that has the same contents as # "c:\winnt", including subdirectories. It does NOT create a directory # "c:\saved_winnt\winnt" with the same contents as "c:\winnt". # Verifying Token Contents: # To check the value of a token (especially if there is a question about a # user defined token) use this syntax. This saves the token s value so that # it can be it can be verified after the backup cycle finishes: # cmd 'echo %SITE_DB_NAME%' %BACKUP_DEST_DIR%\SiteDBName.txt # When troubleshooting syntax errors, it s possible to save time by making a # copy of the control file and commenting out tasks that are running properly. # If the backup is being run on a test site, manually stop the site services, # comment out the control file s "[Stop]" and "[Start]" # sections, and manually start backup. # Start backup by starting the SMS_SITE_BACKUP service. If enough tasks are # commented out, a backup cycle can take only a few seconds. # The backup task s default directory is on the site server, in the same # directory as the SMSBKUP.EXE that runs backups. If the site server s # machine type is i386, the default directory is "\sms\bin\i386\". # When custom executables are used in backup "cmd" tasks without providing # an explicit directory location, backup will first look in its default # directory and then in the path. # 



Microsoft Systems Management Server 2.0 Administrator's Companion
Microsoft Systems Management Server 2.0 Administrators Companion (IT-Administrators Companion)
ISBN: 0735608342
EAN: 2147483647
Year: 1999
Pages: 167

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net