title: The cpanelsync.exclude File
created at: Thu Nov 28 2024 10:38:47 GMT+0000 (Coordinated Universal Time)
updated at: Sat Feb 08 2025 14:22:56 GMT+0000 (Coordinated Universal Time)
---
# The cpanelsync.exclude File
# Overview
Use the `/etc/cpanelsync.exclude` file to prevent updates to cPanel-distributed files. This method causes fewer problems than other methods of update prevention (for example, the use of the `immutable` state).
!! Note:
!! This method **only** prevents an update from the `cpanelsync` utility. It does **not** prevent updates that occur at application runtime.
!! You **cannot** use the `cpanelsync.exclude` file to prevent modifications to configuration files, datastores, or similar types of files.
!! You **cannot** block updates to package-managed files within the `/etc/cpanelsync.exclude` and `/etc/cpanelsync.no_chmod` files.
!! For more information about custom cPanel packages, read our [How to Build and Install Custom RPMs on Red Hat Systems](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-build-and-install-custom-rpms-on-red-hat-systems) documentation.
!! To determine whether a package manages a particular file, run the following command:
!! On Red-Hat servers:
!! `rpm -qf /path/to/file`
!! - On Ubuntu servers:
!! `dpkg -S /path/to/file`
# Entries
Each entry in the `/etc/cpanelsync.exclude` file **must** use an absolute path, with each path on its own line.
For example, you may wish to prevent an update to the following files:
```bash
/usr/local/cpanel/scripts/pkgacct
/usr/local/cpanel/Cpanel/Logd.pm
```
Use the following commands to add the files’ path to the `/etc/cpanelsync.exclude` file:
```bash
echo "/usr/local/cpanel/scripts/pkgacct" >> /etc/cpanelsync.exclude
echo "/usr/local/cpanel/Cpanel/Logd.pm" >> /etc/cpanelsync.exclude
```