SharePoint Services 3.0 creates its own SQL instance which needs to be backed up. Here are a couple of steps you can take to do a manual back up and purge older backups.
Step 1: Create a batch file and setup a task on the server that you are attempting to backup.
Here is a batch file I've used from http://technet.microsoft.com/en-us/library/cc288541(office.12).aspx
backupsharepoint.bat
cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\BIN
stsadm.exe -o backup -directory "d:\Backup Sharepoint" -backupmethod full
echo completedIt simply changes the directory to "%COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\BIN" and runs stsadmn.exe. Note: The directory this is saving the backup to is "d:\Backup Sharepoint". Follow the instruction from here if you run into any snags.
Step 2: Once you've tested your backup task you can add a script to delete folders older than 10 days using VBS. Here is an example from here: http://windowsxp.mvps.org/wshdelfolder.htm
Create a vbs file called deloldfolders.vbs and save it in the same directory as your backupsharepoint.bat. Here is the code for it.
'DelFolder.vbs - December 1, 2005
'Ramesh Srinivasan
Dim i, fso, f, f1, sf, BasePath, CalcResult, fNameArray()
BasePath = "d:\Backup Sharepoint"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(BasePath)
Set sf = f.SubFolders
For Each f1 in sf
CalcResult = DateDiff("d",f1.DateCreated,Now)
if CalcResult > 10 then
ReDim preserve fNameArray(i)
fNameArray(i) = f1.Name
i = i + 1
end if
Next
For Each fName in fNameArray
FSO.DeleteFolder(BasePath & "\" & fName)
NextThen add this line to the end of your backupsharepoint.bat.
cscript.exe c:\deloldfolders.vbsSo now you should have a task that run backupsharepoint.bat which will backup the databases and purge older backups.
No comments:
Post a Comment