I wanted to copy my web site and subwebs from Go Daddy to my local machine. My trusty old WS_FTP32 client kept disconnecting partway through the (large) download. I installed FileZilla, and while that got further, it ultimately disconnected as well.
I figured if I could compress the larger folders using gzip, I could just download a few compressed files. But this Go Daddy account doesn’t have shell access. How do I run gzip? With a Cron job!
1. Create a gzip_folders.sh file with this content:
cd $HOME/html
tar -czf subweb1.tar.gz subweb1
echo ‘GZipped subweb1’>&2
tar -czf subweb2.tar.gz subweb2
echo ‘GZipped subweb2’>&2
tar -czf subweb3.tar.gz subweb3
echo ‘GZipped subweb3’>&2
The >&2 sends the echo output to stderr, which Go Daddy emails to the the address you specify on the Cron Manager.
2. Upload the file to your Go Daddy account.
3. Important: Change the file’s permissions to allow the file to be executed by the Group. I used 710, which FileZilla displays as follows:
4. In the Go Daddy Hosting Control Center, go to Content > Cron Manager and schedule a cron job to run gzip_folders.sh.
Once the job completes, you should get an email listing the subwebs that were gzipped, and you should see the .tar.gz files in the html folder of your web site.
5. Download those files to your local machine using FTP.
6. Disable the Cron job and delete the gzip_folders.sh file to prevent accidental or malicious execution.
For a significant gain in compression, try bzip2 rather than gzip. E.g.,
tar -cjf subweb1.tar.bz2 subweb1
Thanks Craig. I did a test on this techblog site, which contains 1143 files and 15,964,160 bytes.
GZip compressed to 7,736,269 in about 4 seconds. BZip compressed to 7,345,572 in 8 seconds. So BZip is about 5% smaller.
After downloading the files to Windows, WinZip 10.0 could open the GZip archive, but not the BZip one (even though it is supposed to handle BZip as well).
A fast answer from WinZip support confirms that WinZip can’t read BZip: “WinZip supports bz2 compression -within the zip archive-; it does not support accessing or creating an actual bzip file.” For convenience, I’ll stick with GZip so I can open it with WinZip.
Might not be worth it in your case. For text files, I typically see archives about 20% smaller for bzip2 compared to gzip.
7-zip is probably a better all-around archiving and compression tool than WinZip:
http://www.7-zip.org/