Click Contact to fill out an online requirements questionnaire.
Thanks!
Current Articles | Archives | Search
When I first started working with Sharepoint 2007 I was frustrated having to use Central Administration to perform backups. I personally prefer the command line. I wanted a way to quickly perform farm backups and individual site backups without starting up Central Admin. Fortunately stsadm.exe and Powershell came to my rescue. Below are two functions that I first made to perform farm and site backups.
Steps to use the scripts
$HotFolder = "E:\Backup\HotBackup\" + (Get-Date).dayofweek + "\"
function SpFarmBackup { if (Test-Path $HotFolder) { Remove-Item $HotFolder -recurse New-Item $HotFolder -type directory } else { New-Item $HotFolder -type directory } $cmd = "stsadm -o backup -backupmethod full -directory " + $HotFolder + " -overwrite" & cmd /c $cmd
}
function SpWebBackup ( $SiteName, $FileName) { $Backup = $HotFolder + $FileName + ".bak" $cmd = "stsadm -o export -url " + """$SiteName""" + " -includeusersecurity -filename " + """$Backup""" + " -overwrite" cmd /c $cmd }
In my next post I will show you a more robust backup solution for Sharepoint with Powershell.
Name (required)
Email (required)
Website
Notify me of followup comments via e-mail