Exclude WP Core Files From Backup Using cpbackup-exclude.conf

HedSpaces

Member
Jan 22, 2020
21
5
3
Ottawa, Ontario, Canada
cPanel Access Level
Root Administrator
Twitter
I would like to exclude these directories from my backup using cpbackup-exclude.conf:
- all the WordPress core files/directories - except the wp-content directory
- the "themes" and "plugins" directories from wp-content directory

I would like to do this because I assume all these can be uploaded in case of a restore.

My query is:
1) is this possible?
2) am I in error to assume all these can be uploaded in case of a restore?
3) am I running into problems if I have to do a restore?

Also, I am unclear as to the path to enter into cpbackup-exclude.conf to any particular directories. Would examples be:
directory > username/public_html/wp-admin
file > username/public_html/wp-cron.php
sub-directory > username/public_html/wp-content/plugins

System: VPS CENTOS 7.9 xen v94.0.4
Assistance would be greatly appreciated.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,282
2,434
363
cPanel Access Level
Root Administrator
Hey there!

1 - Sure, but I'm not sure it's worth it because these are typically not very large and not where much of the disk space gets used. Most of the actual usage would be the database and wp-content.
2 - It depends on exactly what files you plan to exclude. For example, the main wp-config.php would have the username and database connection details there, which would not be saved elsewhere.
3 - It wouldn't cause problems, but it would definitely involve more manual work.

If you are creating a local exclude for an individual user, you would make the files relative to that user's home directory path, as shown in the example at the bottom of this page:

 

HedSpaces

Member
Jan 22, 2020
21
5
3
Ottawa, Ontario, Canada
cPanel Access Level
Root Administrator
Twitter
Thank you, cPRex, for your advice.
This is what I thought but the owner of the site is looking to reduce the backup as much as possible instead of increasing the disk size.
The backup is temporarily stored on the disk before being uploaded to our offsite backup client then deleted from the disk, and the disk is running out of space to hold this temp backup.
Your second opinion is greatly appreciated and answers my questions.