


WEBMON BACKUP WINDOWS
While this script could just be scheduled with the Windows Task Scheduler, I wanted to centralize the scheduling, parameter control, and monitoring with Ops Mgr.
WEBMON BACKUP FULL
To implement this, the script loads meta-data from the Table of Contents XML file into an array, determines the number of backups to be purged (correlated to the current backup operation type – full or differential), flags the oldest backups for deletion, and then deletes the related backup directories and XML nodes.Īutomating With System Center Operations Manager 2007 While an example of deleting backups older than a certain time interval can be found here, I wanted to maintain past backups based on a count (x number of fulls, x number of differentials). The stsadm backup operation maintains an XML file named spbrtoc.xml in the backup directory with meta-data related to past backups. The most complex operation of this WSS backup automation script is the maintenance of old backups. (Although the WScript.Shell supports basic EventLog logging, I wanted to control the event source and ID, so the eventcreate.exe utility seemed to be a better option).Ĭommand = “Eventcreate /L Application /T INFORMATION /ID 943 /SO “”SharePoint Backups”” /D “” ” & sMesg & “”Ĭommand = “Eventcreate /L Application /T WARNING /ID 944 /SO “”SharePoint Backups”” /D “” ” & sMesg & “” To improve monitoring of the operation, the script performs a shell execution to the eventcreate.exe utility to log status to the Windows Application Log.
WEBMON BACKUP INSTALL
The backup operation is relatively simple: the script uses the method to execute the stsadm.exe command (after querying the registry to determine the install path of WSS).Ĭommand = sPath & “\STSADM.exe -o backup -Directory ” & BackupDir & ” -BackupMethod ” & BackupType The script is a bit too long to post in its entirity, but it can be downloaded here. I opted to go with the catastrophic backup method in this script to support differential backups and eliminate the requirement to enumerate individual sites for backup operations. The site collection method backups up an individual site and content for an individual site, specified by URL, and the catastrophic backup method backs up the entire farm or a specified object in a full or differential mode. The stsadm.exe utility can be used to backup in two modes, site collection and catastrophic. I recently took on a task to script a more robust solution for the automation of WSS farm backups, which I will describe here. Although SQL backups of the content databases for a Windows SharePoint Services farm can be used for data recovery, it’s usually a good idea to also perform backups through the stsadm.exe utility to facilitate site and object-level restores.
