Introduction
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.
Procedure
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:
nano /etc/cpbackup-exclude.conf
*/.wysiwygPro_*
*/core.[0-9]
.MirrorSearch
.cpan
.cpanel/caches
.cpanel/datastore
.cpcpan
.sqmailattach
access-logs
public_ftp/.ftpquota
# add new entries here
example/
dir/example.php
Paths added to the exclude files are relative to the user's home directory.
Comments
0 comments
Article is closed for comments.