Automate cPANEL Backups

Hosting HOWTOs Software Web Development

For months I have been manually backing up my web sites. Last night, I learned my lesson and realized I needed to have something more dependable in place. (and I am pretty damn dependable). I finally took the time to research the process of automating a CPanel update.
The script I found and used is freely available and easy to use.

How to completely automate your CPanel backup and store the files remotely:

There are three main parts to this process:

  • The backup script.
    • Download the script.
    • Edit the script’s configuration variables as needed (see instructions on the download script page (see above).
    • Set up a cron job via CPanel (cron jobs is one of the main icons in the list) so your script will run every x minutes/hours/days/weeks/months.
  • The files you want backed up on your host. The script will have CPanel perform a full backup of all your files and databases. (The same if you were to choose “full backup” within the Backup module of CPanel.)
  • The location where your files go when they are automatically backed up.
    • Define the server/computer you want your files to get backed up to. If you are like me and do not have a static IP address for the computer you want all your backups to go to (my home computer), you will need to set up Dynamic DNS. (See my HOWTO access your home computers from anywhere post.)
    • Set up FTP access to your server/computer (in my case my home computer) so the script can grab the backup and transfer it to your server/computer.

That is all you will need to do. You will be emailed every time this process runs so you will always know when your last backup was/if it was successful. Depending on how many active changes you are making to your web site, you will want to adjust the frequency of the backup. For a web site like this, I will back it up every 7 days. Why five? When thinking about backup strategies, I always think: how many days of work can I afford to lose? Figuring I have a new post every weekday, I can live with a week’s work lost. If I do a code change, a WP update, or a massive posting that I do not want to lose, I will do a manual backup to supplement my backups.

Another recommendation…always keep the latest copy of the backup on the server (your web host) as well as on your home server/computer. This way, you are ok if something were to happen to your home machine or your web host. (I like to have archived copies always available)
[tags]CPanel, backup[/tags]

One thought on “Automate cPANEL Backups”

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

UNIX

Nagios Updated

Hi. I spent my exciting day with my old friend Nagios. Due to a few issues, I had to move my Nagios install to a new server, and while I had the time to move it, I also decided it was time to tweak it some. I wanted to point out that Nagios was updated […]