Posted On January 23, 2013

Powershell komutu ile bir klasörü sıkıştırıp yedeğini almak

dearly 0 comments
Yazilimcinin Gunlugu >> Uncategorized >> Powershell komutu ile bir klasörü sıkıştırıp yedeğini almak
##Oncelikle Backup'ini alacagimiz uygulamanin pathini yaziyoruz
$kaynakPath="\\cronus\e$\IIS_APP\ironiccolakoglu"
##Dosya Adini olusturuyoruz
$tarih=Get-Date
$dosyaAdi= $tarih.Year.ToString()+$tarih.Month.ToString()+$tarih.Day.ToString()+"_"+$tarih.Hour.ToString()+$tarih.Minute.ToString()+".zip"
##Yedeklerin gonderilecegi Pathi veriyoruz
$hedefPath="D:\recep\"
##New-Item -ItemType directory -Path $hedefPath

##Pscx modulu ile Backup alinacak klasoru zipliyoruz
Import-Module Pscx
Write-Zip -level 9 -IncludeEmptyDirectories -Path $kaynakPath -OutputPath $kaynakPath$dosyaAdi
##Zip dosyasini HedefPath'e tasiyoruz
Move-Item $kaynakPath$dosyaAdi $hedefPath

Not:Zipleme özelliğini kullanmak için Pscx modülünü yüklemelisiniz. http://pscx.codeplex.com/releases/view/98267

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Sharepoint 2010 üzerinde bir sayfayı popover (pop-up dialog) şeklinde gösterme

SharePoint üzerinde farklı listelerden veri alan bir webpart hazırladım. Listedelerdeki tün kolonları alabiliyordum, hatta liste…

Bugün Doğanlar listesi yapmanız için aşırı pratik çözüm

Bugün hiç kod yazasım yoktu. Boyuna sörf yaptım, ne var ne yok vs. Bir yandan…

Getdate() with LINQ or Entity / LINQ veya Entity ile Getdate() nasil cekilir?

EN:Sometimes we need to use getdate() function instead of DateTime.Now. Because with getdate() we can…