Navratri Festive Offer: 50% Off Cloud Hosting + FREE Migration Get It Now!
The need for performing regular backups of a cPanel server cannot be overemphasized because data, no matter how well protected, is never safe from crashes, corruptions, or catastrophes such as accidental deletion. Yet, it doesn’t mean that all files within a server must go through this process of backup. This paper will address the importance of excluding unnecessary files in order to free space in storage, minimize backup of the extra files, and enhance the performance of computer systems.
This guide will provide all the steps you need to properly configure the cPanel server's settings to exclude files from the backup process.
The web hosting control panel, sometimes referred to as cPanel, is a graphical web-based operating system interface that facilitates server-related task management. One of its many built-in capabilities is System Backup, which lets you backup all or just parts of your website—that is, files, databases, email accounts, configurations, and more.
Generally, users were provided with backup services, which automatically backed up all the users’ data by default. But this may have non-business files containing clipart, saved emails, history files, temporary files, logs, or big media files stored on other devices. There may be many files that are not needed for system work, and excluding those files can be beneficial and make your backup storage more effective.
Before diving into the steps to exclude files, it's important to understand the benefits:
Save Storage Space: Backup storage can be expensive. By excluding non-essential files, you reduce the amount of space required.
Reduce Backup Time: Smaller backups mean faster backup processes. This is particularly beneficial if you have large amounts of data.
Improve Restoration Time: In the event of a failure, restoring from a smaller backup is quicker, minimizing downtime.
Focus on Critical Data: Ensuring that only vital data is backed up can simplify your disaster recovery plan.
The first step is to identify the files and directories that you don't need to back up. Common candidates for exclusion include:
- Cache directories (e.g., /home/username/public_html/cache)
- Temporary files (e.g., /home/username/tmp)
- Log files (e.g., /home/username/logs)
- Large media files that are stored elsewhere or are non-critical
cPanel allows you to specify files and directories to exclude using an exclude file. This file should be named cpbackup-exclude.conf and placed in the root directory of the user account (/home/username).
bash
Copy code
# Exclude cache directories
public_html/cache/
# Exclude temporary files
tmp/
# Exclude logs
logs/
# Exclude specific large files
public_html/videos/
After creating the cpbackup-exclude.conf file, upload it to the user account's root directory in cPanel. You may accomplish this with cPanel's File Manager, SSH, or FTP.
Make that the exclusions are functioning as intended after uploading the exclude file. This may be accomplished by doing a manual backup and making sure the backup files do not contain the designated directories and files.
With your exclusions set up, you can automate your backups using cPanel's built-in backup configuration. Go to the Backup section in cPanel and configure the settings according to your needs. Make sure to enable regular backups to ensure your data is protected consistently.
If you have root access to your server and use WHM (Web Host Manager), you can configure global exclude rules that apply to all accounts on the server.
Log in to WHM: Access your WHM control panel.
Navigate to Backup Configuration: Go to Backup > Backup Configuration.
Edit Global Exclude File: Under the Files tab, you will find an option to edit the global exclude file. This file works similarly to the cpbackup-exclude.conf file but applies to all user accounts.
bash
Copy code
# Exclude common temporary and log directories
*/tmp
*/logs
*/cac
Save Configuration: After editing the global exclude file, save your changes and ensure that backups are running correctly with the new exclusions.
- Regularly Review Exclusions: Periodically review your exclude file to ensure that it still meets your needs. As your website grows, your backup requirements may change.
- Test Restorations: Regularly test backup restorations to ensure that you can recover data when needed.
- Monitor Backup Storage: Keep an eye on your backup storage usage to avoid unexpected costs or storage limits.
- Update Exclude Rules: If you add new directories or files that should be excluded, update your cpbackup-exclude.conf or global exclude file accordingly.
Another very basic yet useful technique for optimizing your cPanel backups is eliminating some unnecessary files from the FTP backups. The guide above will help you achieve optimum backup solutions whereby the process exits as quickly and cheaply as possible with less importance on the unwanted data. By scheduling it to be reviewed and updated often, the basic backup exclusion rules can be adjusted according to the current necessity.
Let’s talk about the future, and make it happen!