Question about cpbackup-exclude.conf
I just need some clarification with regards to how cpbackup-exclude.conf.
During nightly backups I notice that cPanel first copies the homdirectory to the cpbackup/daily/account/ folder. Does the folders and files listed in the cpbackup-exclude.conf file also gets copied in this phase? Does the file copy script immediately exclude those files?
Or does the files/folders on cpbackup-exclude.conf only get excluded during the tar process?
The reason I ask is that we have a temporary folder that will contain large number of files and subfolders during normal operation. I have included this folder into the cpbackup-exclude.conf file so it does not get included in the final archive. But the backup process is starting to take too much time. I looked at the backup logs and I see these lines:
Copying homedir.............
.........
.........
.........
That is followed by 2000+ more ".........". The lines after the "Creating Archive..." line is much less.
So this looks, at least to me, that the excluded folders still gets included in the homedir copy and only gets excluded in the archive creation process. Can anyone confirm if this is correct?
If it is correct, can anyone suggest a workaround so that the excluded files/folders don't get copied to shorten the time it takes for the backup to complete? I am thinking of turning those temporary folders into symlinks and putting it into another location. Will the filecopy process still follow these symlinks?
Thanks,
-
Question about backups, I see that during the nightly backups the homedir first gets copied to the cpbackup/daily/account/ folder before it gets tar'd. Are the files/folders in the cpbackup-exclude.conf file also gets copied or are they already ignored by the file copy script? Or are the excluded files only get ignored by the tar process? Two of our accounts have a temporary folder that contains a large number of files and folders. These temporary folder get changed a lot (subfolders and files get removed/created as their individual cache time expires). We already have listed this temporary folder in the cpbackup-exclude.conf for that account. The problem is that the nightly backup process is taking too much time to complete. I suspect that the culprit is the temporary folder. There are lots of "....." lines after the "Copying homedir" line in the backup log but only a few lines after the "Creating Archive" line. So this looks, at least to me, that most of the time is spent on copying the home folder. Is my assumption correct? If so, can anyone suggest how I can instruct cpbackup's homedir copy script to do not copy this temporary folder? Is there a setting for this? I am also thinking of moving the temporary folder into a separate location and then just creating a symlink so that our scripts can still locate the temporary folder. Will cpbackup's homedir copy script follow these symlinks? Thanks! 0 -
Hello, Files and directories in cpbackup-exclude.conf will get skipped from both tar and gzip. Here is the documentation on how to use cpbackup-exclude.conf 0 -
Peter, How would I set in /etc/cpbackup-exclude.conf to exclude any kind of */cache* files or directories? just like that? */cache*
?0 -
[quote="luigidelgado, post: 1732332">Peter, How would I set in /etc/cpbackup-exclude.conf to exclude any kind of */cache* files or directories? just like that? */cache*
?
Yes, however you should likely restrict it to your public_html directories. EX:public_html/cache/*
Thank you.0 -
Ok... In the case caches are in a subdirectory inside public_html (for example: public_html/subdir/cache) would that work? Or should I use public_html/*/cache/* ? 0 -
You could add an additional entry: public_html/cache/* public_html/*/cache/*
Thank you.0 -
Hello, If the files are stored in the account's home directory, then you should remove the initial wildcard from your entry. EX: backup-*tar.gz Thank you. 0 -
A lot of thanks. 0 -
So to exclude all files and directories in an account's home directory, the contents of /home/example_account/cpbackup-exclude.conf would just be: *
Is that right? That would be because I only want to backup the account's database(s).0 -
Is that right? That would be because I only want to backup the account's database(s).
Hello, Yes, that would exclude all files from the account's home directory. Thank you.0 -
Thanks. Also I am wanting to exclude the e.g. /home/example_account/mail folder and everything inside the mail folder on every account in /home So I edited /etc/cpbackup-exclude.conf and added mail/* ... and I checked my backups this morning and the /home/example_account/mail folders have still been added to the accounts. What do I put in /etc/cpbackup-exclude.conf to exclude /home/example_account/mail and all files and sub-folders please? 0 -
Re. my above post. That has actually worked as I intended, I tried to edit or delete the above post and the system wouldn't allow me to. Thanks. 0 -
Re. my above post. That has actually worked as I intended, I tried to edit or delete the above post and the system wouldn't allow me to. Thanks.
I am happy to see it worked as expected. Thank you for updating us with the outcome.0 -
Hi, i am using cpbackup-exclude.conf to exclude /mail directory and subdirectory for most backups, but would like to include it in a less frequent backup (say fortnightly). Is there a command line way to get cpanel backup to ignore cpbackup-exclude.conf? Thanks. 0 -
Hi, i am using cpbackup-exclude.conf to exclude /mail directory and subdirectory for most backups, but would like to include it in a less frequent backup (say fortnightly). Is there a command line way to get cpanel backup to ignore cpbackup-exclude.conf? Thanks.
You could temporarily remove the exclusions and force a backup generation via:/usr/local/cpanel/bin/backup --force
Thank you.0 -
Sorry to bump up the old thread but this seems to be a good place to add up my questions too. I am, in fact, looking for a include setting. For example, incase of WordPress sites, I would exclude */wp-*
but then I would includewp-content
andwp-config.php
because those two and database are the only things that matter for a WordPress site. But by allowing me to do so, my cpbackup-exclude.conf would be much cleaner and easier to read. My another question is if I can add comments in cpbackup-exclude.conf by preceding a hash sign (#) like a regular .conf file? I am asking this because my hosting size is big and can't risk to break the backup process. Thank you.0
Please sign in to leave a comment.
Comments
17 comments