Database Backups using a cron job

This guide is about creating a cron job in cPanel to make a backup of your databases. This article is intended for Ch-center clients who use cPanel and have access to create a cron job through the cPanel interface. Ch-center clients are encouraged to keep a working backup before performing any upgrades, site maintenance or before making changes in case the database needs to be restored.

How To Set Up a Cron Job to Backup Your Database

  1. Login into cPanel 
  2. Navigate to the Advanced section and click on Cron Jobs
    cPanel Cron Jobs
  4. Enter the email address for notifications 
  5. Select a common setting from the drop down menu, such as once per week
  6. Select a non peak hour to run the cron job
  7. Enter in the following into the command area:

Replace the following three items

  1. <cPanelUserName> with your cPanel username
  2. <FILE_NAME_HOME_DIRECTORY_> with the name of the backup
  3. <cPanelPassword> with your cPanel account password
  • Each time the cron job runs, this will create a .sql and append the day, month and year to the end of the file.

To ensure your account does not build backups of your databases and increase your account’s disk space usage, it is important to download copies of these backups to your computer and remove them from your server

Confirm Your Backups

It’s a good idea to login to your account and check that these files are being created. That way, if you need to restore your database from a backup, you can download the file and restore your database from a backup. If you use cPanel, you can do this by logging into File Manager. Simply confirm that these files exist and check the timestamp of when the backup was created once you are logged into File Manager.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Banning Traffic to Your Site

When you have a web site you want to bring in as much traffic as possible. But sometimes you...

cPanel Definitions of the Stats Panel

The Statistics panel in cPanel is a collection of various stats from your cPanel account. This...

Creating an Addon Domain

By creating an addon domain, you can control multiple domains from a single account. This allows...

Definition of Advanced Icons

The Advanced section in cPanel allows users to setup and manage more advanced functionality for...

Definition of Files Icons

The Files section in cPanel houses a collection of options that all deal with your website’s...