pkgacct backup trick to obey cpbackup-exclude.conf no longer works

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
To my horror, it looks like the newest versions of pkgacct not only do not obey the "backup" term added to the command line but they also exclude the homedir by default.

It looks like adding --backup (with dashes) will do a full backup, but that still does not obey cpbackup-exclude.conf

Also, there is still absolutely no way to exclude logs from a pkgacct since cpanels makes it's own logs directory (excluding access-logs does not work)

Is there any way to make this work again or is it time to move on from cpanel?
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
There have been several threads about cpbackup-exclude.conf before

I had working cpbackup-exclude.conf and it was being obeyed

But since the changeover to the newer perl I believe everything stopped working

As a test I have

directory
/directory
directory/
*/directory
directory/*


None of them work, none of them are being obeyed anymore

CENTOS 6.5 x86_64 WHM 11.42.0 (build 5)

Oh and looking at the /scripts/pkgacct it would be incredibly easy for cpanel to add a --nologs option, you already have a conditional wrapper on the logs portion.

But the logs are the least of my problems.
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
Okay it looks like /scripts/pkgacct had a major rewrite over the years.

This line breaks things

$_ = $homedir . '/' . $_ if ( index( $_, '/' ) != 0 );

It tampers with the rules in a way that breaks them.

If I comment it out, pkgacct obeys the rules.

Note I am backing up to a directory outside of $homedir (as root) so it is possible the exclusion process runs after the files are copied and not before and since they are not in $homedir, they are never obeyed.
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
cPanel Access Level
Root Administrator
What I am saying is this:

at some point in the past year, cpanel significantly changed/rewrote pkgacct

it no longer obeys cpbackup-exclude.conf because of a bug, which is a major problem for large sites

and it still does not have any way to exclude logs, even though that would be super easy to do in the code to add an option

Fortunately I know enough to be able to manually patch pkgacct myself but I had to waste an hour or so on it when we've been paying for multiple cpanel licenses for years and it should not be necessary to patch things by hand.

I think others that rely on cpanel are going to surprised to see pkgacct no longer obeying exclusions.

Steps to reproduce
1. Create a dummy file in a dummy directory under a dummy user ie. /home/test/public_html/testing/abc.txt
2. Edit the /home/test/cpbackup-exclude.conf and try to insert rules to exclude abc.txt or the testing directory entirely
3. Move outside the /home/test directory, say for example /backup
4. Backup using /scripts/pkgacct test /backup/ backup
(the last "backup" on that line is to trigger the cpbackup mode instead of the cpmove mode and the file name will be simple)
5. unpack the /backup/test.tar.gz file and then notice despite your rules, /testing/abc.txt is still in there

For the record, this method worked for years.
It broke sometime in the past year.
If finding the date is critical, we keep backup logs so I could go through it month by month to find when backups started to bloat.
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
at some point in the past year, cpanel significantly changed/rewrote pkgacct
I can't speak to this directly, but cPanel has added an entirely new backup system. I would think that script was a part of that.

I am unable to duplicate the issue, when excluding a directory. It works fine for me here. I have a directory with 450MB of files in it, I ran my backup and checked size. Killed that backup and added the directory to cpbackup-exclude.conf and then ran backup again. That directory was skipped as expected.

I'm using the new backup system, not legacy. I did not attempt to do this again with a file name excluded, or file type.