A common assumption on WHM servers is that the backup system skips cache and temporary folders on its own. It sounds reasonable, since nobody wants to restore a page cache. When a nightly backup runs into the morning, or one account's archive is much larger than its real content, the cause is often a WordPress cache directory, a session folder, or an application temp path. Directories like these can hold hundreds of thousands of small files, and they went straight into the tarball because nothing told the backup to leave them out.
Why cache folders end up in the archive
A cPanel account backup packages the account's home directory along with its databases, mail, and configuration. Any path that is not listed in an exclude file is treated as account data. The backup system has no general way to know that wp-content/cache is disposable while wp-content/uploads is not. To the backup, both are directories full of files.
Size is only part of the cost. Every file has to be found in a directory walk, checked with a stat call, opened, read, given its own tar header, and then compressed. With a few large files, the disk reads in long sequential runs. With a million tiny files, most of the time goes to metadata and random reads. During the backup window, that raises iowait for every site on the server, not only the account being backed up. The same files also use up inodes, which is its own problem and is covered in cPanel Says the Inode Limit Is Reached but Disk Space Is Fine.
There is a restore cost too. If you restore an account with its old page cache, the site can serve outdated pages until someone purges the cache.
From the support side, tickets usually say 'backups are slow' or 'backup failed, disk full'. The useful first question is not how many gigabytes an account uses. It is which directory in that account holds the most files.
How the two exclude files work
cPanel reads two plain text files when it decides what to leave out.
The global file is /etc/cpbackup-exclude.conf. It is owned by root and applies to every account on the server.
The per-user file is cpbackup-exclude.conf in the account's home directory, for example /home/username/cpbackup-exclude.conf. It applies only to that account.
Both files take one entry per line. On current versions, both lists are generally applied when both exist, but confirm this against the cPanel documentation for the version you run. The per-user file sits in the user's home directory, so the account owner can edit it. That means site owners can exclude paths too. Remember this when a restored account is missing files nobody remembers excluding.
Do not assume you know what the global file contains on your server. Read it, and check the inode-heavy directories before you decide what to add:
# Global exclude list (applies to all accounts)
cat /etc/cpbackup-exclude.conf
# Per-user exclude list, if the account has one
cat /home/username/cpbackup-exclude.conf
# Directories with the most files (inodes) in the account, top 20
du --inodes -x -d 3 /home/username 2>/dev/null | sort -n | tail -20
The du --inodes output counts files and directories rather than bytes. A cache folder that looks small in a normal du -sh can sit at the top of this list.
Writing entries that actually match
As a rule of thumb, entries in the per-user file are written relative to the account's home directory. A per-user file for a WordPress site and a Laravel app on the same account might look like this:
public_html/wp-content/cache
app.example.com/storage/framework/cache
The second line shows a common gap. Addon domains and subdomains often have document roots outside public_html, so a pattern written for the main site does not cover them. Check where each site actually lives before you write the entry.
In the global file, every entry applies to every account, so admins usually reach for wildcard patterns. How patterns are matched has varied in detail between cPanel versions. The differences include whether a pattern is relative to the home directory or matched anywhere in the path, and how trailing slashes are handled. Read the documentation for your version, then verify against a real archive instead of trusting the file.
The usual ways an entry fails without any error:
- A typo or wrong path, such as
public_html/wp-content/caches - A trailing slash that stops the pattern from matching on some versions
- An entry in the wrong account's file, or a file saved in the wrong directory
- A pattern that is too broad, such as one matching any path containing 'cache', which also removes directories you wanted to keep
The last one is the most dangerous because it looks like success. The backup gets smaller and faster, and nobody notices until a restore is missing something.
Confirm the path is really gone from the archive
The exclude file shows what you asked for. The archive shows what happened. After the next backup run, list the archive contents and check in both directions: the cache path should be absent, and real content should still be there. For compressed daily backups, the archive is usually at a path like the one below. Replace the date with a backup directory that exists on your server:
# Count archive entries under the cache path (0 means it was excluded)
tar -tzf /backup/2026-11-06/accounts/username.tar.gz | grep -c 'public_html/wp-content/cache/'
# Sanity check: real content should still be present (expect a non-zero count)
tar -tzf /backup/2026-11-06/accounts/username.tar.gz | grep -c 'public_html/wp-content/uploads/'
Listing a large archive reads the whole file, so expect it to take some time and run it outside peak hours on a busy server. Uncompressed and incremental backups are stored as directory trees instead of tarballs. For those, check whether the path exists under the account's backup directory instead of using tar.
Two more points. Exclusions only affect backups created after the change. Older archives keep the cache files until retention rotates them out, so total backup disk usage drops gradually. To confirm that the change improved backup time, compare run durations in the backup logs under /usr/local/cpanel/logs/cpbackup/ before and after the change, rather than relying on a general sense that it feels faster.
What to exclude and what to leave alone
The safe candidates are files the application rebuilds on its own. That includes page cache directories, compiled template caches, framework cache folders, and PHP session files if the app stores them in the account. Losing sessions on restore usually just means users log in again.
Be more careful with anything whose name only suggests it is disposable. Some plugins store generated files under a folder called 'cache' that are the only copy of something, and some applications keep queue or import data in 'tmp'. On cPanel, the account's ~/tmp directory typically also holds web statistics data such as AWStats. Excluding the whole folder means losing that history on restore. Before you exclude a path, ask whether the application can rebuild it from scratch with no manual steps. If you are not sure, leave it in the backup and find out first.
Never exclude uploads, mail, or anything users created themselves just to make the backup smaller. A smaller backup that cannot restore the site is worse than a slow one.
If backups are slow or oversized, don't assume WHM is skipping caches. Find the inode-heavy directories with du --inodes and add specific entries to the global or per-user cpbackup-exclude.conf. Then list the next archive to confirm that the cache is gone and the real content is still there.