cPanel & WHM

How to exclude files and folders from cPanel backups

There are two ways to exclude files and folders from cPanel backups. Either by using the server’s global exclude file where you exclude certain files and folders server-wide or, by using a local exclude file in the user’s home directory. We’re going to cover both.

Think carefully before you exclude anything from backups. If something goes wrong like a hard drive failure you could lose your data. You should always have backups of everything you place on any server. If you are excluding a file because of its size there are other options you can choose. Plugins in CMS programs like WordPress have great backup options that can split files to make them more manageable.

Globally exclude files and folders From cPanel Backups

To exclude files or directories from your backups for all user accounts, add those files or directories to a cpbackup-exclude.conf file.

nano /etc/cpbackup-exclude.conf

Then place the files and directories into the file. Remember these are the files and directories to exclude from cPanel backups;

/public_html/cgi-bin
/public_html/folder
/public_html

Exclude files with a local exclude file

If you have a High Availability Web Hosting account, you can exclude files or directories from your backups for your account. To exclude files or directories from an individual user’s cPanel backups, add the files or directories to an exclude file. Name the file cpbackup-exclude.conf. If the file does not already exist, you must create it. To do this, run the following command:

nano /home/cpusername/cpbackup-exclude.conf

Then place the files and directories into the file like so;

/public_html/cgi-bin
/public_html/folder
/public_html/index.html

How was this article?

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button