cpbackup-exclude.conf question.

RyokoX

Registered
Mar 20, 2015
4
1
3
Bulgaria
cPanel Access Level
Root Administrator
Hello Everyone,

I'm struggling with making this work, and any suggestions are greatly appreciated.

With my current setup, /etc/cpbackup-exclude.conf is configured to exclude all public_html directories as those are backed up via another method which is not relevant to the issue.

Is there any possibility to keep using the main cpbackup-exclude.conf in /etc/ to exclude the directories from being backed up by the server-wide backups done from WHM, while still retaining the ability for my users to generate full cPanel backups including the public_html directories from their accounts using the backup wizard?
 

Alejandro P

Well-Known Member
Apr 6, 2007
51
0
156
cPanel Access Level
Root Administrator
Hello, I need something similar with an additional detail.

I would like exclude not only the public_html but exclude all users homedir. One idea would be a custom backup script, but I would prefer to have this done via system cpbackup.

Regarding your query, might you change the cron to include an alternate cpbackup-exclude.conf?

Cron content might look like this backup_excluding.sh

#!/bin/bash

/bin/mv cpbackup-exclude.conf cpbackup-exclude.conf_default
mv cpbackup-exclude.conf_excluding_public_html cpbackup-exclude.conf
/usr/local/cpanel/scripts/cpbackup
/bin/mv /etc/cpbackup-exclude.conf /etc/cpbackup-exclude.conf_excluding_public_html
/bin/mv /etc/cpbackup-exclude.conf_default /etc/cpbackup-exclude.conf

Then add a cron job like:
0 3 * * 0 /root/backup_excluding.sh 2>&1

/root/backup_excluding.sh should have 755 permission.
 

Alejandro P

Well-Known Member
Apr 6, 2007
51
0
156
cPanel Access Level
Root Administrator
Hello, I have solved my request by adding * at the cpbackup-exclude.conf file.

Along the process found this

Note:

If you initiate a Home Directory backup in cPanel's Backups interface (Home >> Files >> Backups), the global and local exclude files do not affect the contents of the backup file.
in

https://documentation.cpanel.net/display/CKB/How+to+Exclude+Files+From+Backups

It would be great if cpanel separate Cpanel account configuration from Cpanel Full backups, that way one could transfer just configuration and download, rsync or ftping the account Home Directory solving the problem of transfers in cases user account space is reduced.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,912
2,241
363
It would be great if cpanel separate Cpanel account configuration from Cpanel Full backups, that way one could transfer just configuration and download, rsync or ftping the account Home Directory solving the problem of transfers in cases user account space is reduced.
Hello,

You can use the "--skiphomedir" flag with /scripts/pkgacct if you want to backup accounts through the command line, excluding the account's home directory. EX:

Code:
/scripts/pkgacct --skiphomedir test01
Thank you.