I'm trying to create a backup from Godaddy's shared hosting envinronment for a friend. The sites entire file is about 2GB, and Godaddy doesn't support archiving files more than 20MB. The only option is to use server side tar.

Basically I'm facing a problem when Cron only does half it's job, only compressing up to 300MB out of 1GB+.

Here's the script I'm using,

/bin/tar -cvzf $HOME/html/fullsite_test.tgz $HOME/html > $HOME/html/Out.log 2>&1

And here's what I filled in Godaddy's command,


Does anyone know why it's not working as intended? I've even deal with the stderr and stdout, so I'm still not sure what's going on....

Note: $HOME is the absolute directory path of the account.

  • Any clues in that log you're creating? – John Gardeniers Jan 20 '11 at 9:32
  • Indeed, it would be interesting to see the log – lynxman Jan 20 '11 at 9:46
  • When you say it's only compressing 300MB, does it successfully create a .tar.gz that only contains some files, or does it get "cut off" at 300MB? Godaddy may have a per-file disk quota in place (to prevent movie sharing or something). – Kyle Smith Jan 20 '11 at 14:07

The first thing of note is that the path you are backing up includes the backup itself!!!!

Assuming this is a gnu version of tar....Instead of

tar -cvzf $HOME/html/fullsite_test.tgz $HOME/html > $HOME/html/Out.log


tar -cvzf $HOME/html/backup.tgz $HOME/html --exclude backup > $HOME/html/backup.log

Not sure where the 300Mb limit is coming from (are you sure that is the size of the file created, or is that the size of the file you downloaded?) but (again assuming this is Gnu tar) you could do something like:

tar -Mcvzf $HOME/html/backup.tgz $HOME/html \
   $HOME/html/backup.tgz $HOME/html \
   -L 200M -F backup_rotate.sh

Where backup_rotate.sh contains something like:


mv -f $HOME/html/backup_vol4.tgz $HOME/html/backup_vol1.tgz
mv -f $HOME/html/backup_vol2.tgz $HOME/html/backup_vol3.tgz
mv -f $HOME/html/backup_vol1.tgz $HOME/html/backup_vol2.tgz
mv -f $HOME/html/backup.tgz      $HOME/html/backup_vol1.tgz

(it could do with a bit of refinment - but you get the idea?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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