Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.44

What are my backup options?

You can configure backups for your server in WHM's Backup Configuration FAQ interface (Home >> Backup >> Backup Configuration). This interface allows you to configure how backups run on your server.

What does the system store in a backup?

System backups include system files and directories. Account backups include home directory contents, databases, email and email settings, DNS records, and other account related information.

Which files does cPanel user's backup include?

After you enable account backups, the backup process runs as the cPanel user who owns the backed up data. The system does not back up anything that a user does not own and cannot access

  • The system includes all of the files that the user owns in the backup.
  • The system includes any files that the user does not own but has access to in the backup.

Can I select specific users' accounts to back up?

You can select specific user accounts to back up with WHM's Backup Configuration FAQ interface (Home >> Backup >> Backup User Selection).

How are DNS zones handled?

If you use a DNSONLY cluster, the pkgacct script examines all of the DNS zones in the DNS cluster to find the record with the newest serial number. It then stores that DNS zone in the backup.

By default, the backups are cluster aware and pull the account's zone from the DNS cluster itself. You can choose the option to pull from the local machine when you enable the Use Local DNS option within WHM's Backup Configuration FAQ interface (Home >> Backup >> Backup Configuration).

How can I use rsync with a cPanel & WHM backup?

We do not support a backup procedure that uses the rsync script. While it is possible to use the rsync script with cPanel & WHM backups, we strongly recommend that you use our tools to ensure reliable backups. Under certain conditions, the rsync script may corrupt SQL database backups.

Which scripts run backups?

The following scripts are the main scripts that run backups:

/usr/local/cpanel/bin/backup
/usr/local/cpanel/scripts/pkgacct

Where can I find backup logs?

You can find backup logs in the /usr/local/cpanel/logs/cpbackup/ directory. The log names correspond to the second at which the system created them, in UNIX epoch time.

Where are backups stored?

Select the location in which you wish to store backups in WHM's Backup Configuration FAQ interface (Home >> Backup >> Backup Configuration).

To select the location in which you wish to store backups, perform the following steps:

  1. Navigate to WHM's Backup Configuration FAQ interface (Home >> Backup >> Backup Configuration).
  2. Scroll down until you see the Configure Backup Directory section.
  3. Enter the location where you wish to store the backups in the text box.

    Note:

    You must provide an absolute path to the local backup directory.

  4. Click Save after you make your changes.

The BACKUPDIR value opens the /etc/cpbackup.conf and /var/cpanel/backups/config files and finds where your server shows backups.

: awk '/BACKUPDIR/{print FILENAME": "NR": "$0}' /etc/cpbackup.conf
/var/cpanel/backups/config
/etc/cpbackup.conf: 8: BACKUPDIR /backup
/var/cpanel/backups/config: 28: BACKUPDIR: /backup

What does the system back up when I select configuration files? Where can I find the backups?

When you back up configuration files, the system automatically stores the files in the dirs and files directories. When you back up the entire MySQL directory, its contents are stored in the dirs directory.

cPanel & WHM backs up the following files and directories:

Files

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

Directories

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

To configure system backups to include custom files or directories, create a new file or directory in the /var/cpanel/backups/extras directory (for example, /var/cpanel/backups/extras/etc). In that file, enter a fully qualified path to any files that you wish to back up (for example, /etc/example.conf).

Note:

The server administrator can edit the /etc/my.cnf file to change the MySQL® data directory location. In such a case, WHM will back up the directory at its new location.

Can I run backups on a mounted filesystem?

If you use a mounted filesystem to store backups, we strongly recommend that you mount the system with the noexec option. If you pass the noexec parameter to the mount parameter, the binaries cannot run on the mounted filesystem.

You can configure a filesystem to use noexec by default whenever it mounts. To do so, edit the /etc/fstab file. This file contains a list of filesystems that you can mount on your system. To configure a mountable filesystem that automatically uses noexec, edit its entry in the /etc/fstab directory to reflect the following example:

* *nfs        /path/to/nfs       ext3        defaults,noexec        0  0*

The example above describes the following configuration options:

DeviceDefault Mount PointFilesystem TypeMount OptionsDump Optionfsck Order
nfs/path/to/nfsext3defaults, noexec00

Can I control when backups run?

You can choose the days that backups run in WHM's  Backup Configuration FAQ interface (Home >> Backup >> Backup Configuration). You must manually alter times that backups run.

  • You can choose what days to run backups and how many to retain in the Scheduling and Retention section of the  Backup Configuration interface (Home >> Backup >> Backup Configuration).
  • You can choose the time backups run. To do this, you must manually edit the root user's crontab.
    • For example, by default, the backup runs at 2:00 am. To change this time to 3:30 pm, run the following commands:
      1. Run the crontab -l command to see when the Backups crontab runs. You will receive output that is similar to the following example:

         

        0 1 * * * /usr/local/cpanel/scripts/cpbackup
      2. Run the crontab -e command to open the cron editor.
      3. Alter the 0 2 * * * /usr/local/cpanel/bin/backup line to resemble the following line:

        30 15 * * * /usr/local/cpanel/bin/backup

        Note:

         For more information about the time syntax of Crontab, read the Wikipedia Cron page.

Note:

You can manually edit the dates on which backups run in the /var/cpanel/backups/config file.

My backup partition is locked and will not unmount itself. How do I fix this?

There is a known incompatibility when cPanel & WHM runs on CloudLinux under Centos 5.X. After a nightly backup runs or a restore runs, the backup partition gets stuck in an active lock.

The next time that you perform a backup or a restore, you will see an error that is similar to the following example:

[backupmount] Cannot umount: /backup. This mountpoint is still in use and has an active lock 

mount: /dev/sdb1 already mounted or /backup busymount: according to mtab, /dev/sdb1 is already mounted on /backup
To resolve this, run the following commands as the root user:
mount -r /backup
mount -o remount,rw /backup
umount /backup