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.40

What are my backup options?

You can configure backups for your server with the Backup Configuration feature (Home >> Backup >> Backup Configuration). This interface allows you to configure how backups will run on your server.

What is stored up 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 are included in a cPanel user's backup?

After you enable account backups, the backup process runs as the cPanel user whose data is backed up. Anything a user cannot access is not backed up.

This means:

  • All of the files owned by the user are included in the backup.
  • Files the user does not own but has access to are included in the backup.
  • Files the user does not own and cannot access are not included in the backup — even if they are stored in the user's home directory.

Can I control which users' accounts are backed up?

You can use the Backup User Selection feature (Home >> Backup >> Backup User Selection) to select specific users.

How are DNS zones handled?

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

By default, the backups are cluster aware and will pull the account's zone from the Cluster itself. Within the Backup Configuration Page, you can choose the option to pull from the local machine when you enable the option to Use Local DNS.

How can I use rsync with a cPanel backup?

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

Which scripts run backups?

There are numerous scripts that run backups. The main scripts responsible for backups are:

  • /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 logs are named according to the second they were created in UNIX epoch time.

Where are backups stored?

You can decide where to store backups. Use the Backup Configuration feature (Home >> Backup >> Backup Configuration ) to select the location where you want to store backups:

  1. Access the Backup Configuration feature (Home >> Backup >> Backup Configuration ) from your WHM interface.
  2. Scroll down until you see the Configure Backup Directory section.
  3. Enter the location where you would like to store the backups in the text box.

    Note:

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

  4. Click Save when you have made all of your changes.

You can also open the /etc/cpbackup.conf and /var/cpanel/backups/config files and find the BACKUPDIR value which shows where backups are stored:

: 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 gets backed up when I select configuration files? Where can I find the backups?

If configuration files are set to be backed up, they will be automatically stored in directories called dirs and files. When the entire MySQL directory is backed up, it can be found in the dirs folder.

The following directories are backed up into dirs:

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

The following files are backed up into files:

  • /etc/exim.conf 
  • /etc/exim.conf.localopts 
  • /etc/fstab 
  • /etc/group 
  • /etc/httpd/conf/httpd.conf 
  • /etc/ips 
  • /etc/localdomains 
  • /etc/my.cnf 
  • /etc/named.conf 
  • /etc/passwd 
  • /etc/pure-ftpd.conf 
  • /etc/quota.conf 
  • /etc/remotedomains 
  • /etc/rndc.conf 
  • /etc/secondarymx 
  • /etc/shadow 
  • /etc/wwwacct.conf 
  • /root/.my.cnf 
  • /usr/local/apache/conf/httpd.conf

I want to run backups on a mounted filesystem. Can I do this?

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 mount, the binaries cannot run on the mounted filesystem.

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

* *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 are run?

Yes. You can choose the days that backups run in the Backup Configuration feature, but you have to manually alter times that backups are run.

  • You can choose what days to run backups and how many to retain in the Scheduling and Retention section of the Backup Configuration feature (Home >> Backup >> Backup Configuration ).
  • You can choose the time backups run. To do this, you have to manually edit root's crontab.
    • For example, by default, the backup runs at 2:00 am. To change this to 3:30 pm, run the following commands:
      1. Run crontab -l to see when the Backups crontab runs. You will receive output similar to the following: 0 1 * * * /usr/local/cpanel/scripts/cpbackup
      2. Run crontab -e to open the cron editor.
      3. Alter the 0 2 * * * /usr/local/cpanel/bin/backup line to read 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 backups are 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 runs on CloudLinux under Centos 5.X. After a nightly backup runs or a restore runs, the backup partition will get stuck in an active lock.

The next time you perform a backup or a restore, you will see an error 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 error, you will need to perform the following commands as root:
mount -r /backup
mount -o remount,rw /backup
umount /backup