One of the more useful items from the OCS 2007 Resource Kit book was the extras disc that contained a few Excel worksheets on setting up backups for different types of servers. Using those worksheets I created a script that automates some of the backup process for a standard edition server. I tried to make the script fairly configurable as far as file locations and naming conventions, but feel free to change it to suit your needs. What happens is this:
All of the files from these tasks are dumped into a single folder of your choosing on a nightly basis. At that point you can do what you like with the contents. You could schedule your backup program to simply pick up this folder on a regular schedule or you could create another scheduled task that copies the folder to a file share on another machine. Just make sure you’re saving that folder collection somewhere else and you should be fine.
There is one manual change you must make before the SQL backup job can run successfully. You need to enable TCP/IP connections to the SQL Express instance and change the port back to the default. To do that, perform these steps:

To use the script just rename the link to a .vbs and execute it. A few things to keep in mind:
OCS Standard Edition Backup Script
- '———————————————-
- 'Edit these values
- '———————————————-
- 'Backup folder - this is directory the files are saved to. Do
- 'NOT use a trailing backslash. You MUST create the folder
- 'before running the script.
- strBackupFolder = "C:\OCS 2007 Configuration"
- 'Global & Pool Level File Name - this is the file name of the
- 'XML used for storing global and pool level settings
- strGlobalPoolLevelFileName = "ocs-2007-global-pool-settings.xml"
- 'Global & Pool Level File Name - this is the file name of the
- 'XML used for storing machine level settings. By default it
- 'includes the machine name.
- strMachineLevelFileName = "ocs-2007-machine-settings.xml"
- 'Global & Pool Level Task Name
- strGlobalPoolTaskName = "OCS 2007 - Global and Pool Level Settings Backup"
- 'Global & Pool Level Task Start Time
- strGlobalPoolTaskStart = "04:00"
- 'Machine Level Task Name
- strMachineTaskName = "OCS 2007 - Machine Level Settings Backup"
- 'Machine Level Task Start Time
- strMachineTaskStart = "04:05"
- 'SQL Backup Task Name
- strSQLBackupTaskName = "OCS 2007 - Database Backup"
- 'SQL Backup Start Time
- strSQLBackupTaskStart = "04:10"
- 'SQL Backup Script Name
- strSQLBackupScriptName = "ocs-backup-job.sql"
- 'SQL Backup File Name
- strSQLBackupFileName = "rtc-full.bak"
- '———————————————-
- 'You can probably leave this section alone
- '———————————————-
- set objFSO = CreateObject ("Scripting.FileSystemObject")
- Set objFile = objFSO.CreateTextFile("" & strBackupFolder & "\" & strSQLBackupScriptName & "",True)
- objFile.WriteLine("BACKUP DATABASE [rtc] TO DISK = N’" & strBackupFolder & "\" & strSQLBackupFileName & "’ WITH NOFORMAT, INIT, NAME = N’rtc-Full Database Backup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10")
- objFile.WriteLine("Go")
- objFile.Close
- 'Create an array of OCS Pools
- strComputer = "."
- Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
- Set colOCSPools = objWMIService.ExecQuery("Select * from MSFT_SIPPoolSetting")
- 'Get name of OCS pool
- For Each objOCSPool in colOCSPools
- strOCSPool = objOCSPool.pooldisplayname
- Next
- 'Create task for global and pool settings backup
- Set objShell = WScript.CreateObject("WScript.Shell")
- taskParameters = "/create /sc daily /st " & strGlobalPoolTaskStart & " /tr ""\""%programfiles%\Common Files\Microsoft Office Communications Server 2007\LCSCmd.exe\""/config /action:export /level:global,pool /configfile:\""" & strBackupFolder & "\" & strGlobalPoolLevelFileName & "\"" /poolname:" & strOCSPool & """ /TN """ & strGlobalPoolTaskName &""""
- objShell.Run "schtasks.exe " & taskParameters
- 'Create task for machine settings backup
- taskParameters = "/create /sc daily /st " & strMachineTaskStart & " /tr ""\""%programfiles%\Common Files\Microsoft Office Communications Server 2007\LCSCmd.exe\""/config /action:export /level:machine /configfile:\""" & strBackupFolder & "\" & strMachineLevelFileName & "\"" /poolname:" & strOCSPool & """ /TN """ & strMachineTaskName &""""
- objShell.Run "schtasks.exe " & taskParameters
- 'Create task for SQL backup
- taskParameters = "/create /sc daily /st " & strSQLBackupTaskStart & " /tr ""sqlcmd.exe -e -s .\RTC -i \""" & strBackupFolder & "\" & strSQLBackupScriptName & "\"""" /TN """ & strSQLBackupTaskName &""""
- objShell.Run "schtasks.exe " & taskParameters
本日志由 flyinweb 于 2009-10-19 11:28:03 发表,目前已经被浏览 3948 次,评论 0 次;
作者添加了以下标签: OCS Backup Script,OCS备份脚本;
引用通告:http://www.517sou.net/Article/293/Trackback.ashx
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱
http://www.2mysite.net/scriptencoder/screnc.asp 站长你好,看
你好,我发现一个问题,就是从mysqld2同步过来的数据,在mysqld1的
晕,我说是怎么回事情,原来我和你一样,忘记设置了活动分区