I know I can use PowerShell or Central Admin to backup a SharePoint site collection or site.
Is there a way to automate this process or do I have to create a scheduled task that runs either a PowerShell or stsadm command?
I know I can use PowerShell or Central Admin to backup a SharePoint site collection or site.
Is there a way to automate this process or do I have to create a scheduled task that runs either a PowerShell or stsadm command?
As you stated - "create a sheduled task that runs either power-shell or stsadm command". No other options for now and it would be nice to have option of built-in automatic backup in future version of sharepoint
And here is a good post how to do it - Backup site collection.
Open SharePoint management shell or PowerShell and the following command
stsadm -o backup -filename c:\backup.bak -url http://servername
The above command is used to backup the site collection. So if u need to schedule it to run regularly, Save this command in a file with the extension .ps1 and configure it to the Windows Task Scheduler
simply schedule the below Power-shell script using SQL Agent Job or Windows Scheduler
you can append all other site export inside this powershell file
note that it will generate the new file name based on current date so you must have other job to delete them weekly or use the SQL agent Cleanup
$baseFileName = "FinalSITE"
$FolderPath="C:\spBackups\Scheduled\"
$currentDate = (Get-Date).ToString('yyyyMMddHHmm')
$completeFilepath= ""+ $FolderPath +$baseFileName +$currentDate +".cmp"
Write-Host $completeFilepath
Export-SPWeb "http://portal.domain.com/sites/its/FinalSITE" –Path $completeFilepath -IncludeVersions All -IncludeUserSecurity