SPSFAQ
SharePoint Server Frequently Asked Questions
affiliate links


Buy a sponsored link

You could have a link to your website on every page of SPSFAQ.


Backup and Antivirus for SharePoint

SPSFAQ050221 - How can I create SPS backups with a date included? - 0 Comments - stephencummins - Mon, Mar 21st, 2005 - Backup/Antivirus
I just use this script that creates a timestamped folder. You can remove the hours, minutes and seconds if you don't need them:

This is what it does: It creates a subfolder with the timestamp in the folder name at the path you specify in line 37:

Set f = fso.CreateFolder("C:\SPS_Backup\SPSPortal-" & yr & "-" & mo & "-" & dt & "-" & hr & "-" & min & "-" & sec)

The folder name is not just the date, it has the time in there too.

Then it runs SPSbackup.exe and backs up the entire portal to this folder, there should be at least 5 files in there.

Put in the path to your backup folder in line 37 and make sure line 47 is the correct path to the SharePoint bin folder where spsbackup.exe is

Setup a scheduled task in windows to have that script run daily. In the command box ensure you type "cscript [path to your file].vbs" (without the "" of course).


'''''''''''''
'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("C:\SPS_Backup\SPSPortal-" & yr & "-" & mo & "-" & dt & "-" & hr & "-" & min & "-" & sec)

bkFolder = f.Path
bkFolder = Replace(bkFolder, "", "\")
bkFolder = bkFolder

'''''''''''''''''''''''''
'Run the spsbackup script
'''''''''''''''''''''''''
Set objShell = CreateObject("WScript.Shell")
objShell.CurrentDirectory = "e:\Program Files\Sharepoint Portal Server\bin"

objShell.Exec ("spsbackup.exe /all /file " & bkFolder & "\SPSBackFile")

' WScript.Echo "Backup Started!"

I have disabled Comments for a while. Blame the writers of comment spam!

Page 1 of 1  -  Jump to: 1

Search options
Search for
   
In fields
   
In category
   
Dated in
   

links
subscribe
Get the latest posts via email:

quick search
Search via Google:

random books


Copyright © SPSFAQ.com, Stephen Cummins Limited, All Rights Reserved