How to Exclude Files from Backups?

Overview

To exclude files or directories from your user backups, perform either of the following actions:

  • Exclude the files from all users’ backups

  • Exclude the files from an individual user’s backups.

The global and local exclude files apply to the account backups that you manage in WHM’s Backup section (WHM >> Home >> Backup) and the Download a Full Website Backup feature in cPanel’s Backup interface (cPanel >> Home >> Files >> Backup).

Global exclude file

To exclude files or directories from your backups for all user accounts, add those files or directories to the /etc/cpbackup-exclude.conf file. The /etc/cpbackup-exclude.conf file excludes the files that you specify relative to any location from which the backup script runs.

The backup system excludes the following files and directories for all users’ backups by default:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
*/.wysiwygPro_*
*/core.[0-9]
.MirrorSearch
.cpan
.cpanel/caches
.cpanel/datastore
.cpcpan
.sqmailattach
access-logs
public_ftp/.ftpquota

Local exclude file

To exclude files or directories from an individual user’s backups, add the desired paths (relative to the user’s home directory) to the cpbackup-exclude.conf file in the user’s home directory, with one entry per line.

If the file does not already exist, you must create it. To do this, run the following command:

touch /home/username/cpbackup-exclude.conf
Note:
  • In this example, username represents the name of the user who owns the files or directories.

  • If you enter a directory name, the backup system excludes all of the files that exist in the directory.

  • When you specify files, do not include leading or trailing characters of any kind, such as slashes (/) or periods (.).

Example

For example, to exclude the /home/username/example/ directory and the /home/username/dir/example.php file from the username user’s backups, create the following /home/username/cpbackup-exclude.conf file:

1
2
example/
dir/example.php
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How addon domain parked outside public_html dir

There's an option to disable this here:WebHost Manager »Server Configuration »Tweak Settings,...

Fix cPanel Error “IP Address Has Changed!”

This document will cover how to disable the security for Cookie + IP Authentication.  Step 1:...

How to Install Imagick on cPanel Server

Install ImageMagick on the server. SSH into your server Install it by typing: yum install...

How to disable LFD excessive resource usage alert?

Login Failure Daemon(LFD) is a daemon process which runs on VPS or Dedicated servers that uses...

Fix Automatic Disconnects from WHM & cPanel

The fix is simply changing an option in the settings of WHM. To do this, log into WHM and find...