cPanel & WHM users can exclude user's files or directories from backups either by excluding the files from all users' backups or excluding the files from an individual user's backups.

The global and local exclude files apply to the account backups that you manage in WHM's Backup section (WHM >> Home >> Backup) and the Download a Full Website Backup feature in cPanel's Backup interface (cPanel >> Home >> Files >> Backup).

It's worth noting that when a backup is run with the /scripts/pkgacct script, the global and local exclude files will not affect the contents of the backup file.

 

As a WHM root admin, you can exclude files or directories from backups for all user accounts by adding those files or directories to the /etc/cpbackup-exclude.conf file.

The /etc/cpbackup-exclude.conf file excludes the files that you specify relative to any location from which the backup script runs.

To exclude files or directories from an individual user's backups, add the desired paths (relative to the user's home directory) to the cpbackup-exclude.conf file in the user's home directory, with one entry per line.

If the file does not already exist, just create it with the following command.

touch /home/username/cpbackup-exclude.conf

where the username represents the name of the user who owns the files or directories.

A typical example would be excluding the /home/username/example/ directory and the /home/username/dir/example.php file from the username user's backups by creating the following /home/username/cpbackup-exclude.conf file:

example/
dir/example.php

Notice the trailing slash in example/?

It must be included when you exclude a directory path.

Помог ли вам данный ответ? 1 Пользователи нашли это полезным (1 голосов)