cpbackup with FreeBSD and tar/gtar..

beddo

Well-Known Member
Jan 19, 2007
159
1
168
England
cPanel Access Level
DataCenter Provider
Hi there, I've been puzzling over a few things.
I'm running FreeBSD 7.0 Release and I was having problems with some automated scripts (not cpanel) throwing out:

Code:
tar: Truncated write; file may have grown while being archived.
After looking around I found that this was an issue with FreeBSD's tar so I installed gtar from the ports.

Unfortunately, now cpbackup is throwing a wobbler. I have multiple accounts telling me:

Code:
Copying homedir..../usr/local/bin/gtar: ./randomdir/: Cannot savedir: Permission denied
/usr/local/bin/gtar: Exiting with failure status due to previous errors
Then I notice more problems.

Apparently the old backups with FreeBSD's tar were having the same problems, it just wasn't exiting with a failure:

Code:
Copying homedir....tar: ./public_html/forum2: Couldn't visit directory: Permission denied
Done
On top of that, cpbackup doesn't seem to bother emailing me about most of the failures it just occasionally picks one at random to say "The backup of x's account encountered errors"

So what on earth is the expected behaviour? It mustn't have done this previously because I moved everything from one server to another over Christmas using the backup files. The old server was FreeBSD 6.2 I think.

Anyone come across these?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
During the backup process, tar (gtar) is executed as the user, not root. Hence when the tar process encounters a file it cannot access an error is generated.
 

beddo

Well-Known Member
Jan 19, 2007
159
1
168
England
cPanel Access Level
DataCenter Provider
Thanks for the reply, I had gathered that much however it doesn't explain why FreeBSD's tar and gtar produce different results and why cpbackup only chooses to notify sometimes about some of the accounts that have errored.

At this rate it might be easier to drop the homedirs out of the cpbackup and use one of my other scripts to back it up..I'm sure there's logic for changing tar to run as the user but its a pain in the arse when end users are in control of their permissions (and when the public_ftp folders that aren't even in use seem to change their permissions by themselves..)