Zip file 1 kb

Jan 23, 2012 at 12:17 AM

Sometime the zipped folder like the 14hive has a size of one KB and when we take a look inside the file tis last one contains nothinh.

Is it possible for any raison the zipping process can't grab the file like if theyr was locked by another process?

Jan 23, 2012 at 7:51 AM

Search for Start-Sleep and increase time to something like 5  minutes and try again. It's possible the script is exiting before compression is complete. Let me know how you get on.

Change to:  Start-sleep -s 300

Incidentally, where are your diagnostic logs located? Default location C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS

I have encountered something similiar when the Diagnostic and Usage logs were in the 14Hive.  If you are encountering this then i will make the required changes.



Jan 23, 2012 at 3:50 PM


I'm not using the default location.

For the compression issue, i did a change on the execution order. I put in first all the zipping action and after the Backup of the farm and the site.

When I Increased the start-sleep delay it was not enough but with the little change I did, now it looks better. Maybe you can alter your script with this change?

function Start-FarmBackup
	Backup-RelatedTargets # Backup related targets including: GAC/14Hive/ULSLogs
	Backup-IIS # Backup IIS components including: SharePoint Virtual Directories, Metadata (IIS Config) & web.config
	Backup-Sites # Backup all sites in farm
	Backup-Farm # Backup SharePoint farm 	  
	Load-BackupTocXML # Load spbrtoc.xml
	Email-BackupLog # Email latest spbackup.log to nominated recipients.
Jan 23, 2012 at 5:03 PM

Again, Thanks for the feedback.

I am not entirely happy with using COM for zipping the files. I was using this previously: and did not encounter these issues but I didn't want to make the script dependant on a DLL.

Definitely something I will look at improving.


Nov 27, 2014 at 12:47 PM
As per this problem see the issue and solution I wrote -