Knowledgebase: WHM > Backup > Backup Configuration
Backup Configuration
Posted by Matthew Jeffels, Last modified by Matthew Jeffels on 19 October 2016 12:48 PM

Backup Configuration

The Backup Configuration interface allows you as a system administrator to customize your scheduled backups.

Currently it is strongly recommended by cPanel .Inc & WHM that you only use the Backup Configuration interface to configure your backups of your server. They plan on removing the Legacy Backup Configuration interface in a future release.

The configuration that you create here will be applied to any account that you create or transfer for your users and will act as the default backup settings for them.

Enabling and Running Backups

For backups to be enabled and ran you must complete the following.

You must select "Enable" in the "Backup Status" setting in the "Backup Configuration" interface and select the desired settings.

You must use the "Backup User Selection" interface (Home >> Backup >> Backup User Selection) to enable backups for each desired cPanel user.

You can enable or disable backups for all users by selecting the checkbox in the top right corner of the Backup User Selection interface.

Global Settings

These settings are applied to all users as their default settings. 

Backup Configuration Settings

Backup Status

This setting allows you to Enable or Disable whether backups will run. 

Backup Type

This setting allows you to choose the type of backup that will be run and determines how your system will store the backup files. You can choose from the following;

Compressed; Selecting this option will cause all your backups to be saved in a compressed format. This will use less disk space however it will require more time to complete.

Uncompressed; Selecting this option will store all your backups in an uncompressed format. This will use more disk space but is faster than a compressed backup.

Incremental; Selecting this option will only store a single uncompressed backup file. The system will save updated account information to the existing backup file and remove outdated information. This setting will however limit your restoration options, but runs faster and uses less disk space than other options. Warning if you choose to use incremental backups you will not be able to restore an account to a time before the last backup. 

Maximum destination timeout in seconds

This setting allows you to define how long (in seconds) that you will allow the system to run the backup process in an attempt to upload a single backup file or restore a single backup file. This should be a value that is large enough for your server to successfully complete your largest backup file. 

Scheduling and Retention

The Scheduling and Retention section of the options allows you to set when the backup processes should run and how frequently. You can choose to run backups on a daily, weekly or monthly basis, or a combination. Simply select the checkbox's that match the frequency of updates that you wish to run. At least one of these must be selected.

Backup Configuration Settings

Backup Daily

With this option your server will create a new backup on each of the days of the week that you specify. When you select this you also need to select the days of the week that you wish to run the backups on. In addition in the "Retain Daily Backups" textbox you should enter the maximum number of daily backups that you wish to store. This can be anything from 1 to 9999, remember however you will need the space to store them.   

Backup Weekly

With this option your server will create a new backup once a week on the day that you specify. When you select this you also need to select the day of the week that you wish to run the backups on. In addition in the "Retain Weekly Backups" textbox you should enter the maximum number of weekly backups that you wish to store. This can be anything from 1 to 9999, remember however you will need the space to store them. 

Backup Monthly

With this option your server will create a new backup either once or twice a week on days of the month that you specify. When you select this you also need to select the days of the month that you wish to run the backups on. In addition in the "Retain Monthly Backups" textbox you should enter the maximum number of daily backups that you wish to store. This can be anything from 1 to 9999, remember however you will need the space to store them.

Files

The file settings allow you to configure the information that will be backed up. Simply select the checkbox's that relate to what you wish to backup. You must select at least one of either the "Backup Accounts" or "Backup System Files" checkbox's for backups to be able to run, you may however select both.

Backup Configuration Settings

Backup Accounts

This setting will backup the user files in each cPanel user's home directory. From here you can also open the "Backup User Selection" interface by clicking on the "Select Users" option if you didn't enable backups for your users earlier.

Once you have selected this setting you will also need to select the type of data that you wish to include in these backups.

Backup Suspended Accounts; Selecting the Enable button to will allow suspended accounts to be backed up. If you do not enable this option, your server will not backup the suspended accounts, regardless of their settings in the Backup User Selection interface ( Home >> Backup >> Backup User Selection ).

Backup Access Logs; Selecting the Enable button will backup your server's access logs and the /usr/local/cpanel/domlogs file.

Backup Bandwidth Data; Selecting the Enable button will backup your server's bandwidth data.

Use Local DNS; This option allows you to select the method to use to back up DNS information;

     Disable; The system backs up DNS information from the DNS cluster.

     Enable; The system backs up DNS information from the server for the domain.

Backup System Files

This option allows your server to backup the server's system files. Enabling this will allow your server to backup and store many of the files in the /etc directory.

This option must be enabled if you may ever wish to use server restoration, it is not necessary for account restoration, it is strongly recommended that you enable this setting however.

Databases

This section allows you to select how your servers SQL databases will be backed up, you can select from one of the following.

Backup Configuration Settings

Per Account Only

This will only backup the database for each account using the mysqldump utility.

Entire MySQL Directory

This setting will backup all the databases on the server. It backs up the entire /var/lib/mysql/ directory.

Per Account and Entire MySQL Directory

This setting will perform a comprehensive backup that will copy all the databases for each account, as well as copying the databases of the server as well.

Configure Backup Directory

This section allows you to specify where it is that you wish to save your backups to. It is strongly recommended that you save your backups to a remote location in addition to a local one.

If you do not select the "Retain backups in the default backup directory" setting and do not specify a destination in the "Additional Destinations" setting, the system will return the following error: "Error: Nowhere to back up: no enabled destinations found and retaining local copies is disabled".

Backups and transfers are performed separately. If backups finish faster and more frequently that file transfers you may find that backup files will accumulate on your server and fill the hard drive. 

We  strongly  recommend that you do not perform backups to remote filesystems (for example; NFS, CIFS, smbfs, or other types of network drive systems). While you can store a backup directly to a remote filesystem, cPanel & WHM does  not  support this configuration. We  strongly  recommend that you work with a qualified system administrator to manage this custom backup path to avoid potential risks.

Backup Configuration Settings

Default Backup Directory

In order to change the default backup directory, enter the absolute path to the desired directory location. By default your server will save local backup files to the /backup/ directory.

Retain backups in the default backup directory.

You should select this checkbox if you wish to retain the account backup files in the backup directory after files have been transferred to another destination.

If you do not select this setting, your server will delete the account backup files from the backup directory after the following events have occurred;

     The system has successfully transfers the backup file to at least one additional destination.

     The system has attempted, successfully or unsuccessfully, to transfer the backup file to all of your additional backup destinations.

Mount Backup Drive as Needed.

This setting allows you to mount a backup drive when enabled. This requires a separate mount point and causes the "Backup Configuration" process to check the /etc/fstab/ file for a backup mount.

If a mount exists which has the same name as the staging directory, the "Backup Configuration" process will mount the drive and backup the information to the mount. After the backup process finishes, it will dismount the drive. 

Additional Destinations

This section allows you to save your backups to an additional destination. You may select multiple options however having more will potentially increase the time that the backup process will take. If it runs for too long this may disrupt the next backup process.

In order to restore backups that exist in the additional destinations that you have created, you will need to perform a remote restoration. This will be covered by us in a later article, however you can find out more information about remote restoration in the cPanel documentation found here.

If you have selected to use the "Incremental" backup type you will not be able to add additional destinations.

To save your updated destination but not validate your changes, click on "Save Destination". To automatically validate your information after you save your changes, click on "Save and Validate Destination".

Backup Configuration Settings

Amazon S3

Amazon S3 is Amazons Cloud storage solution, accounts can be created for free, however using the service is not, and costs will depend upon your usage and needs. You can find out more information about Amazon s3 by visiting their web page here

In order to setup Amazon S3 you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted. 

Folder - (Optional) - Enter the name of the folder in which you wish to store your backups, this folder should also be in the bucket that you enter in the "Bucket" text box.

Bucket - Enter the name of the bucket that you wish to store your backups. A bucket is the container in which your Amazon S3 folders and files reside. You must create your bucket in the Amazon S3 management console.

Access Key ID - You will need to use your Amaxon S3 account to generate an access key. After you have generated an access key, enter the access key ID in this text box. Your server uses the access key to authenticate with the Amazon S3 account.

Secret Access Key - You will need to use your Amaxon S3 account to generate an access key. After you have generated an access key, enter the secret access key in this text box. Unless you specify a new password, the server uses the existing password.

Timeout - You should enter the maximum amount of time in seconds that the server should wait in an attempt to establish a connection with the remote server before generating errors. This must be a value between 30 and 300 seconds.
               If the remote server does not respond in this time frame, your sever will make two additional attempts to contact the server. If the remote server does not respond after those attempts, the system administrator (you) will receive an email that notes the failed attempts, and the system will attempt to transfer again the next time that backups run.

FTP

In order to setup a FTP destination you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted.

Backup Directory - (optional) - You will need to enter the directory path in which you wish to store the backups.

Remote Host - Enter the hostname or IP address of the remote server that you are connecting to. Do not include http://, https://, a trailing port, or path information in the address that you enter. In addition do not use local  hosts or loopback addresses.

Port - Enter the port that will be used to communicate with the remote server. By default most FTP destination use the port 21.

Remote Account Username -  You will need to enter the account username for the remote server in this textbox.

Remote Password - You will need to enter the password to the account your using on the remote server.

Timeout - You should enter the maximum amount of time in seconds that the server should wait in an attempt to establish a connection with the remote server before generating errors. This must be a value between 30 and 300 seconds.
               If the remote server does not respond in this time frame, your sever will make two additional attempts to contact the server. If the remote server does not respond after those attempts, the system administrator (you) will receive an email that notes the failed attempts, and the system will attempt to transfer again the next time that backups run.

PassiveFTP - This option allows you to enable PassiveFTP for this connection. You will need to do this only if the FTP server is behind a NAT firewall.

Additional Local Directory

In order to setup an additional local directory you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted.

Backup Directory - You will need to enter the directory path in which you wish to store the additional backups, this is optional.

Mount Backup Drive as Needed - This setting allows you to mount a backup drive when enabled. This requires a separate mount point and causes the "Backup Configuration" process to check the /etc/fstab/ file for a backup   mount.
If a mount exists which has the same name as the staging directory, the "Backup Configuration" process will mount the drive and backup the information to the mount. After the backup process finishes, it will dismount the drive. 

SFTP

In order to setup SFTP you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted.

Backup Directory - You will need to enter the directory path in which you wish to store the additional backups, this is optional.

Remote Host - Enter the hostname or IP address of the remote server that you are connecting to. Do not include http://, https://, a trailing port, or path information in the address that you enter. In addition do not use local  hosts or loopback addresses.

Port - Enter the port that will be used to communicate with the remote server. By default most SFTP destinations use the port 22.

Remote Account Username - You will need to enter the account username for the remote server in this textbox.

Authentication Type - This option allows you to select how you wish to authenticate your connection with the remote server. This can be done in either one of two methods;

Key Authentication - This option allows your server to authenticate its connection with the remote server using a random key. This is the recommended method
Password Authentication - This option allows your server to authenticate its connection to the remote server using password based authentication.

Key Authentication Options - If you have selected to use the Key Authentication option in the Authentication Type setting you will have to enter the following information;

The full path of the private key that is on your server, entered into the "Private Key" textbox. You may click "Generate a new Key" to create a new private key for your server.
The passphrase for your server entered into the "Passphrase" textbox.

Password Authentication Options - If you have selected to use password authentication for the authentication type setting you will need to provide the password for the account on the remote server here.

Timeout - You should enter the maximum amount of time in seconds that the server should wait in an attempt to establish a connection with the remote server before generating errors. This must be a value between 30 and 300 seconds.
               If the remote server does not respond in this time frame, your sever will make two additional attempts to contact the server. If the remote server does not respond after those attempts, the system administrator (you) will receive an email that notes the failed attempts, and the system will attempt to transfer again the next time that backups run.

WebDAV

In order to setup WebDAV you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted.

Backup Directory - You will need to enter the directory path in which you wish to store the additional backups, this is optional.

Remote Host - Enter the hostname or IP address of the remote server that you are connecting to. Do not include http://, https://, a trailing port, or path information in the address that you enter. In addition do not use local hosts or loopback addresses.

Port - Enter the port that will be used to communicate with the remote server. By default WebDAV destinations use the port 80, port 443 is a secure port. cPanel and WHM use port 2077 for non SSL connections and port 2078 for secure SSL connections.

SSL Enabled - You will need to select this check box to enable SSL encrypted connections. WebDAV destinations require that you have enabled SSL encryption.

Remote Account Username - You will need to enter the account username for the remote server in this textbox.

Remote Password - You will need to enter the password to the account your using on the remote server.

Timeout - You should enter the maximum amount of time in seconds that the server should wait in an attempt to establish a connection with the remote server before generating errors. This must be a value between 30 and 300 seconds.
               If the remote server does not respond in this time frame, your sever will make two additional attempts to contact the server. If the remote server does not respond after those attempts, the system administrator (you) will receive an email that notes the failed attempts, and the system will attempt to transfer again the next time that backups run.

Custom

It is strongly recommended that only experienced users attempt to create custom backup destinations. 

In order to setup a custom destination you will need to fill in the following;

Destination Name - Enter a destination name for your backup files. This name appears in your destination table.

Transfer System Backups to Destination - You should select this checkbox if you wish to transfer the system backups to the additional destination. This should only be done over an encrypted connection, Amazon S3 is encrypted.

Script - You will need to enter the absolute path to your custom scripts location on the server here.

Backup Directory - You will need to enter the directory path in which you wish to store the additional backups, this is optional.

Remote Host - Enter the hostname or IP address of the remote server that you are connecting to. Do not include http://, https://, a trailing port, or path information in the address that you enter. In addition do not use local  hosts or loopback addresses.

Remote Account Username - You will need to enter the account username for the remote server in this textbox.

Remote Password - You will need to enter the password to the account your using on the remote server.

Timeout - You should enter the maximum amount of time in seconds that the server should wait in an attempt to establish a connection with the remote server before generating errors. This must be a value between 30 and 300 seconds.
               If the remote server does not respond in this time frame, your sever will make two additional attempts to contact the server. If the remote server does not respond after those attempts, the system administrator (you) will receive an email that notes the failed attempts, and the system will attempt to transfer again the next time that backups run.

Save Configuration

After you have finished configuring your backup settings, click "Save Configuration" that is found at the bottom of the interface.

If you wish to reset all of the settings to the default configuration you can click on "Reset".

Backup Configuration Settings

Running Backups Manually

If you wish to run a manual backup of your server you can do so through the command line by entering the following;

/usr/local/cpanel/bin/backup

If the system considers the backup to be up to date but you still want to perform a backup, run the following command;

/usr/local/cpanel/bin/backup --force

Backup Files and Directories

If you have selected to backup configuration files, which you are advised to do, cPanel and WHM will backup the following files and directories.

Files

/etc/exim.conf /etc/group /etc/reservedipreasons
/etc/exim.conf.local /etc/shadow /etc/quota.conf
/etc/exim.conf.localopts /etc/master.passwd /etc/wwwacct.conf
/etc/namedb/named.conf /etc/passwd /etc/remotedomains
/etc/rc.conf /etc/fstab /etc/rndc.conf
/etc/named.conf /etc/ips /etc/secondarymx
/etc/proftpd.conf /etc/ips.remotemail /etc/my.cnf
/etc/localdomains /etc/ips.remotedns /root/.my.cnf
/etc/httpd/conf/httpd.conf /etc/ips.remotedns /usr/local/apache/conf/httpd.conf

Directories

/etc/namedb /var/lib/named/chroot/var/named/master
/etc/valiases /var/named
/etc/proftpd /var/cpanel
/etc/vdomainaliases /var/spool/cron
/etc/ssl /var/cron/tabs
/etc/vfilters /var/spool/fcron
/usr/local/frontpage /var/log/bandwidth
/usr/share/ssl /var/ssl
/usr/local/cpanel/3rdparty/mailman /var/lib/mysql
/var/lib/rpm  

Thanks

Matt Jeffels
PAC Web Hosting

(0 vote(s))
Helpful
Not helpful

Comments (0)