{"id":160,"date":"2011-03-31T11:18:25","date_gmt":"2011-03-31T09:18:25","guid":{"rendered":"http:\/\/rexxer.kharkov.ru\/?p=160"},"modified":"2011-03-31T11:18:25","modified_gmt":"2011-03-31T09:18:25","slug":"sharepoint-2010-backup","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=160","title":{"rendered":"SharePoint 2010 backup"},"content":{"rendered":"<p>Backup-site.ps1<\/p>\n<blockquote><p>Add-PSSnapIn Microsoft.SharePoint.PowerShell<br \/>\n$backupdestination = &#8220;\/\/server\/SharePoint_BackUp\/&#8221;<br \/>\n[int] $HistoryDays = 5<br \/>\n[int] $minusHistoryDays = -5<\/p>\n<p>#Verify if more then 10 backup exist, old can be deleted<br \/>\n$a = dir $backupdestination |? {$_.name.EndsWith(&#8216;.backup&#8217;)}<br \/>\nif($a.count -gt $HistoryDays)<br \/>\n{<\/p>\n<p>#Delete old files<br \/>\n$DelDate = (Get-Date).AddDays($minusHistoryDays)<br \/>\ndir $backupdestination |? {$_.CreationTime -lt $delDate -and $_.name.EndsWith(&#8216;.backup&#8217;)} | del -force<br \/>\n}<\/p>\n<p>#Create new backup<br \/>\n$siteName=&#8221;http:\/\/spserver\/sites\/Documents&#8221;<br \/>\n$TodayDate = Get-Date -format D<br \/>\n$BackUpFileName = $backupdestination + &#8220;SiteDocuments_$TodayDate.backup&#8221;<\/p>\n<p>Backup-SPSite -Identity $siteName -Path $BackUpFileName\u00a0 -Force<\/p><\/blockquote>\n<p>Backup-Farm.ps1<\/p>\n<blockquote><p>Add-PSSnapIn Microsoft.SharePoint.PowerShell<br \/>\nBackup-SPFarm -Directory \\serverSharePoint_BackUp -BackupMethod full<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Backup-site.ps1 Add-PSSnapIn Microsoft.SharePoint.PowerShell $backupdestination = &#8220;\/\/server\/SharePoint_BackUp\/&#8221; [int] $HistoryDays = 5 [int] $minusHistoryDays = -5 #Verify if more then 10 backup exist, old can be deleted $a = dir $backupdestination |? {$_.name.EndsWith(&#8216;.backup&#8217;)} if($a.count -gt $HistoryDays) { #Delete old files $DelDate = (Get-Date).AddDays($minusHistoryDays) dir $backupdestination |? {$_.CreationTime -lt $delDate -and $_.name.EndsWith(&#8216;.backup&#8217;)} | del -force } #Create new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=160"}],"version-history":[{"count":0,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/160\/revisions"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}