The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cpbackup with FreeBSD and tar/gtar..

Discussion in 'Data Protection' started by beddo, May 11, 2009.

  1. beddo

    beddo Well-Known Member

    Joined:
    Jan 19, 2007
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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?
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    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.
     
  3. beddo

    beddo Well-Known Member

    Joined:
    Jan 19, 2007
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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..)
     
Loading...

Share This Page