Exclude backing up specific filetype globally with cpbackup-exclude.conf
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?
Thank you. -Michael
*.mp3
*.tar.gz
*.zip
Thank you. -Michael
-
Yes. :) The documentation should be of some use: How to Exclude Files From Backups - cPanel Knowledge Base - cPanel Documentation 0 -
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 "*/"? */.wysiwygPro_* */core.[0-9]
In the example I posted I did not specify that, does that make a difference? -Michael0 -
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:*.mp3 *.tar.gz *.zip
Next, assuming you have .mp3's on the account, take a backup. Download it and check it for .mp3's.0 -
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. -Michael0 -
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:*.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.0
Please sign in to leave a comment.
Comments
5 comments