Exclude backing up specific filetype globally with cpbackup-exclude.conf

mvandemar

Well-Known Member
Jun 17, 2006
161
43
178
Sorry to bump an old thread, but this comes up on top in Google and I really don't see it addressed elsewhere. The examples in the documentation for cpbackup-exclude.conf all appear to do with directories. If I want to exclude all of a specific filetype globally on an account, will this syntax work?

Code:
*.mp3
*.tar.gz
*.zip
Thank you.

-Michael
 

mvandemar

Well-Known Member
Jun 17, 2006
161
43
178
I read the documentation, as indicated in my post. I wasn't totally clear on it though. Why, for instance, do the file specific exclusions start with "*/"?

Code:
*/.wysiwygPro_*
*/core.[0-9]
In the example I posted I did not specify that, does that make a difference?

-Michael
 

Infopro

Well-Known Member
May 20, 2003
17,085
521
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Yes it makes a difference. From the docs:
The /etc/cpbackup-exclude.conf file exclude files with a filespec relative to anywhere that the backup script functions. To exclude files or directories from your backups for all user accounts, add those files or directories to the /etc/cpbackup-exclude.conf file.

The backup system excludes the following files and directories for all users' backups by default:

Add the items you asked about to the file on the specific account:
Code:
*.mp3
*.tar.gz
*.zip
Next, assuming you have .mp3's on the account, take a backup. Download it and check it for .mp3's.
 

mvandemar

Well-Known Member
Jun 17, 2006
161
43
178
Next, assuming you have .mp3's on the account, take a backup. Download it and check it for .mp3's.
The issue is that the account is over 100GB, the backup process is dying before completing, and we're winding up with a 0 byte backup. Those files are taking up ~70Gb of the space, so I was hoping that excluding them would allow the backup to complete, but either the pattern isn't working, or it's still not enough trimmed off.

I will create a smaller test cpanel with those exclusions and see if it works on there. Thanks.

-Michael
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
The issue is that the account is over 100GB, the backup process is dying before completing, and we're winding up with a 0 byte backup. Those files are taking up ~70Gb of the space, so I was hoping that excluding them would allow the backup to complete, but either the pattern isn't working, or it's still not enough trimmed off.
Hello @mvandemar,

The "*" character represents a wildcard. For instance, let's say you add:

Code:
*.mp3
This will exclude any file that ends with ".mp3". I added this line to /etc/cpbackup-exclude.conf on a test system and confirmed that a file named "123.mp3" in the "/home/$username/public_html" directory was excluded from the backup generation.

Thank you.