Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a shared hosting account and I want to create a zip (or another archive type) file from whole website.

I asked the hosting support but they don't do this.

Is there any php or Asp.Net script that creates an archive from folder that I can check the compression status, to know it is running and not frozen.

My server has Windows Server 2003 and IIS6 with Plesk 8.6 Control panel.

share|improve this question
    
A Backup utility is pretty common and should be available. Are these instructions any helpful? support.powerdnn.com/index.php?/Knowledgebase/Article/View/11/0/… –  Anagio Feb 28 '12 at 8:26
add comment

3 Answers

Can you not download all the files via FTP, then use your computer to put them in a .zip file? That seems to be the only way to get the files. If you have cPanel, I think there is a tool to download a backup of the site in .zip format already.

share|improve this answer
    
No. I Can't! there is lots of files... Also my hosting control panel is plesk. –  Mahdi Ghiasi Feb 27 '12 at 23:35
    
I can download all of the files for you, (approximately how much data is there?) and then upload a .zip to one of my servers for you to download. Message me if you want me to do that. Otherwise, there's not much else I can help you with. ramui.com/articles/php-zip-files-and-directory.html may help, where you run a PHP script and it will zip all the contents of the folder on the server itself. –  ionFish Feb 27 '12 at 23:51
    
How to send message for you? stackexchange has not private messaging system. –  Mahdi Ghiasi Feb 27 '12 at 23:55
    
you mean mesh@plz.re ?? –  Mahdi Ghiasi Feb 27 '12 at 23:58
    
Ok. I'll try myself and if I need help, I'll contact you. Thanks. –  Mahdi Ghiasi Feb 28 '12 at 0:01
add comment

Most managed hosting providers do daily backups for you. You should be able to just ask them for one of the backups.

Alternatively, if you were on a *nix server, you could just use tar to create a tar.gz archive of your app root. If it only takes 2-3 seconds to archive, there's not much point in a progress bar. If it takes longer, you could use the --list/--index-file or --verbose options to see the files/directories as they're being archived. Or you could use --checkpoint or --block-number to see the record/block numbers as they're processed.

But unlike uploads/downloads, compression progress isn't linear enough to accurately display progress percentage. At best you can use pv to track the number of input bytes processed versus total input size, but the progress bar could go from 0% to 90% in 5 seconds and then take the next 5 minutes to go from 90% to 100%.

Also, it's not like the percentage progress really matters—it's not as if you're gonna decide to pause or cancel the compression. Knowing that it's making progress and hasn't frozen is more important. And this can be easily achieved by using the --list switch to provide a live output of the processed files. You can accomplish all of this with a few lines of PHP and JS.

If you want more accurate progress indication, then you'd have to record how long it took you to archive the site last time and project how long it might take given the current directory size. Assuming the distribution of file types and data characteristics haven't changed significantly, you might be able to get fairly accurate estimates. Or you could go one step further and characterize the compression characteristics (speed/ratio) of specific file types and use that and your app's filetype distribution to calculate the progress.

share|improve this answer
add comment

I have used the SharpZipLib with VB.NET (or C#) with a sample application from their website that creates a tar.gz file from a directory.

http://wiki.sharpdevelop.net/GZip-and-Tar-Samples.ashx

It hasn't progress bar, but I can check if it is complete or frozen by checking the size of tar.gz file via ftp.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.