Script to backup SharePoint Team Services 2
Over at my very popular "Strange SharePoint Restore Issue" post, Rafael was having a problem with restoring a SharePoint backup. Unfortunately it isn't anything I have ran into, all of my experience has been with SharePoint Team Services 2. But Rafael asked me to post my SharePoint backup script anyway. So here it is, but first, a little advice: If you use this script to backup your SharePoint database: '** Begin Copy here "web server extensions\60\bin\" A Good SharePoint Blog: Penny on SharePoint - Penny Coventry MVP's SharePoint blog.
'******************* SPSBK.VBS ****************************************
'** Save this file with a .vbs extension
'**
'** Share Point Services Backup
'** This script is meant to be run periodically to create a backup of
'** a sharepoint site to a local folder.
'**
'** This script runs stsadm with the parameters needed
'** to create a full backup named after the date.
'**********************************************************************
'Create the Variables
dim strCmdPath ' Used to store the path where stsadm is located
dim strBKPath ' Used to store the path where backup files will be stored
dim strFileDate ' Used to store the date which is appended to the file name.
dim strCmd ' Used to hold the entire command sent to the shell.
dim strURL ' Used to store the URL for the Sharepoint Backup
'************************************************************************
' Here is where the location is set. Change these depending on Machine **
'************************************************************************
' This is the path where stsadm is
strCmdPath = "c:\Program Files\Common Files\Microsoft Shared\" & _
' This is the path where backup files will be stored
strBKPath = "d:\SharepointBackups\"
strURL = "http://localhost/sites"
'************************************************************************
' Assemble the date string for the filename
strFileDate = year(now) & "-" & month(now) & "-" & day(now)
' Build the command line.
strCmd = chr(34)& strCmdPath & "stsadm.exe " & chr(34) & "-o backup -url " & _
strURL & " -filename " & strBKPath & strFileDate & "-SharepointBackup.dat"
' Execute the command.
Set objShell = CreateObject("Wscript.Shell")
objShell.Run(strCmd)
'*** End Copy Here
No comments:
Post a Comment