14 de agosto de 2008

SharePoint Backup/Restore/Availability/Scripts

Se ha liberado un centro de recursos en Technet exclusivamente para estos temas, donde podran encontrar ABSOLUTAMENTE TODOS los materiales disponibles : http://technet.microsoft.com/en-us/office/sharepointserver/bb736212.aspx

Y como lo prometido es deuda, a los asistentes del WebCast de Ayer, les dejo el Script de Backup para SharePoint 2007.

””””””’
‘Begin Script
””””””’
Dim fso, f, fspec
dim yr, mo, dt, hr, min, sec

yr = Year(Now)

mo = Month(Now)
if mo < 10 Then
mo = “0″ & mo
end if

dt = Day(Now)
if dt < 10 Then
dt = “0″ & dt
end if

hr = Hour(Now)
if hr < 10 Then
hr = “0″ & hr
end if

min = Minute(Now)
if min < 10 Then
min = “0″ & min
end if

sec = Second(Now)
if sec < 10 Then
sec = “0″ & sec
end if

destFolder = “SPSPortal-” & yr & “-” & mo & “-” & dt & “-” & hr & “-” & min & “-” & sec

Set fso = CreateObject(”Scripting.FileSystemObject”)
Set f = fso.CreateFolder(”D:\SPS2007Backups\SPSPortal-” & yr & “-” & mo & “-” & dt & “-” & hr & “-” & min & “-” & sec) <<<<<<<<< Customize this

bkFolder = f.Path
bkFolder = Replace(bkFolder, “”, “\”)
bkFolder = bkFolder

””””””””””””’
‘Run the spsbackup script
””””””””””””’
Set objShell = CreateObject(”WScript.Shell”)
objShell.CurrentDirectory = “c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\”

objShell.Exec (”STSADM.exe -o backup -directory ” & bkFolder & ” -backupmethod full”) <<<<<<<<<<<<< You can customize this
WScript.Echo “Backup Started!”

———————————————————————————–

Save that as a .vbs file and to run it as a scheduled task go to Control Panel > Scheduled Tasks > Add Scheduled Task > And Follow the Prompts. Happy back-ups!

No hay comentarios.: