How To Exclude Files From Being Backed Up In The cPanel Backup Wizard


When using the cpanel Backup or Backup Wizard (Full Backup) tool, you'll back up lots of files/folders which you won't necessarily want included in the backup. These can include previous backups, email backups (emails are better backed up through your email client) and system files which don't make up an important part of your website content. There is a way by which you can specify directories to be excluded from all future backups made using the backup tools.



Step 1 - Access your File Manager tool in cPanel

Step 2 - Create a text file named cpbackup-exclude.conf in the '/home/cpanelusername/' directory (the top directory in the cPanel account)

Step 3 - Edit the file, add the relative directory of the files/folders you want to exclude, then select Save.

If, for example, you want to exclude the /home/yourweb/public_html/backups/ folder and the /home/yourweb/public_html/oldfiles.zip file, the cpbackup-exclude.conf file would be created in the /home/yourweb/ folder and have this text:
public_html/backups/public_html/oldfiles.zip


For VPS and Dedicated Servers:

To have these exclusions apply server wide, add the file to the /etc/ directory instead. In this case, you'll need root access to the server and the file needs appropriate root permissions. Note that the file may have been created by default. In this case you can just edit the existing file.

If you want to stop the cPanel email folder from being backed up on every account, you can simply add /home/*/mail/ to the bottom of the file:

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


Did you find this article useful?