Backing Up Your cPanel Website

Posted Wednesday, February 10th, 2010 in Tutorials


Backing up your website hosting account is an important part of your internet strategy. Yes, your hosting provider probably makes backups. But should your account get wiped out or defaced, you will have to contact your hosting provider’s tech support and request a restore. All of which costs you time and money due to the downtime of your website.

By making your own backups, you can restore your website the moment you realize something is amiss. And you want those backups to be automated so that you do not have to remember to do it.

This video gives you a tutorial on how to schedule backups of your hosting account using cPanel’s “Cron Jobs” feature. This will backup all of your hosting account with the exception of your mySQL databases:


The command used in the nightlybackup.sh script discussed in the video is as follows:

tar -czf /home/cPanel_username/backup/$(date +%Y%m%d).tar.gz /home/cPanel_username/ –exclude=”/home/cPanel_username/backup/*”

You should replace cPanel_username with the username you use to access your control panel. If this does not work, please contact me and I will be happy to help you with this.

The $(date +%Y%m%d) portion sets the backup file name to the date the backup was made. So if this command runs on January 1, 2010, the backup file will be entitled 20100101.tar.gz.

I hopeĀ  you find this tutorial useful, and let me know what you think in the comments.

I wish you the best in your business.

Tags: ,


  • whoopy
    do i need to change the*backup*name in script ,beacuse i named it *my backup*not just backup,or i need to live it
  • You can name it whatever you like, but if you leave out the date portion you will overwrite your previous backup file every time the script is run.
blog comments powered by Disqus