When backing up large accounts, it can be desirable to skip certain large directories or exclude files for security reasons. Whatever the reason, cPanel offers two methods for excluding files from the standard backup process.
Warnings
-
If you initiate a Home Directory backup in cPanel’s Backup interface (cPanel >> Home >> Files >> Backup), the global and local exclude files do not affect the contents of the backup file.
-
If you perform a backup with the
/scripts/pkgacct
script, the global and local exclude files do not affect the contents of the backup file. -
The
backup-exclude.conf
files only apply to files or directories in a user’s home directory. They do not apply to files or directories outside of a user’s home directory.
Procedure
For all cPanel users
Edit the /etc/cpbackup-exclude.conf file and add the files and folders you'd like excluded from all users' backups.
# nano /etc/cpbackup-exclude.conf
*/.wysiwygPro_*
*/core.[0-9]
.MirrorSearch
.cpan
.cpanel/caches
.cpanel/datastore
.cpcpan
.sqmailattach
access-logs
public_ftp/.ftpquota
# add new entries here
example/
dir/example.php
For one cPanel user
Users or administrators can modify the user-level exclude file. /home/username/cpbackup-exclude.conf excludes files from a specific user's home directory.
$ nano /home/username/cpbackup-exclude.conf
# add new entries here
example/
dir/example.php