How to exclude files/folders from cPanel backups

cPanel offers the possibility to exclude files and folders from all users backups or only from specific users backups. This can help if you know that some directories contain large files. Also, it is useful to exclude temporary directories and files.

cpanel backup folders
WHM backup interface

Server-wide exclude

With this method, you will exclude from backup files and folders for all users backups. The file of interest is:

/etc/cpbackup-exclude.conf

The files/folders excluded by default are:

*/.wysiwygPro_*
*/core.[0-9]*
.MirrorSearch
.cpan
.cpanel/caches
.cpanel/datastore
.cpcpan
.sqmailattach
access-logs
public_ftp/.ftpquota

For example, you can exclude the /home/*/tmp/ directories by adding

tmp

to the list in /etc/cpbackup-exclude.conf


Individual exclude

To exclude files/folders only for specific users, you must edit the file /home/username/cpbackup-exclude.conf

# nano /home/username/cpbackup-exclude.conf

For example, to exclude directory /home/username/softaculous_backups/ and file /home/username/public_html/temp.html use:

softaculous_backups/
public_html/temp.html

Resources:

cPanel Docs

Leave a Reply