views:

34

answers:

0

I'm pretty new to MSBuild so please be gentle with me, I need sample for do this:

I have a msbuild file, mydeploy.targets, to deploy WebSite in remote machine. I want to do backup (of files of remote machine) for each deployment.

I need ZIP a folder in remote machine, for generate ZIP file of all folder (all contents files, folders), and the name of zip using Time and Date actual; and copy zip in a folder named Backup, in remote machine.

update

<Time.GetTime Format="yyyyMMMdd-hh-mm" >
  <Output TaskParameter="Time" PropertyName="backupDate" />
</Time.GetTime>

<Message Text="Comprimiendo en fecha $(backupDate)...."></Message>

<MakeDir Directories="$(Directorio_Backup)\Backups" Condition="!Exists('$(Directorio_Backup)\Backups')" />


<Zip.AddFile
pathToZipFile="$(Directorio_Backup)\Backups\$(nombre_proyecto)-$(backupDate).zip"
pathToFile="@(FicherosDelZip)" />

Zip.AddFile not zip all files that I set in FicherosDelZip.

any sample code about this functionality ??