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.
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 a user’s home directory.
Files can be excluded from backups in two locations:
- System-wide exclude - /etc/cpbackup-exclude.conf
- Per-user exclude - /home/$user/cpbackup-exclude.conf
- Replace $user with the cPanel username
Edit the /etc/cpbackup-exclude.conf file, or create the file if you're configuring a user-level. Include and add the files and folders you'd like excluded from backups. In this example, the system-level exclude file is edited:
# add new entries here
Paths added to the exclude files are relative to the user's home directory.