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.

Changing WHM Backup Ownership

Discussion in 'Data Protection' started by tmorton2, Oct 11, 2012.

  1. tmorton2

    tmorton2 Member

    Joined:
    Oct 11, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I have WHM doing nightly backups to /backup/cpbackup, and I have another server which rsyncs /backup to itself. However, this means I need to give the other server root access, which I'd rather not do. Is there a way to change the permissions which WHM uses for backups? Ideally, I'd like to put the files into the `backup` group and make them group readable.

    Is there any way to do this?
    Thanks!
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    The best way I can think to do this is by using a postcpbackup script hook. Basically, you'd create /scripts/postcpbackup to contain something like this:

    Code:
    #!/bin/bash
    chown -R $user:$user /backup
    </code>
    
    Then chmod the file to 700.

    This way after cpbackup runs, the script hook will execute, chown the files, and your remote server can connect as that user to copy the files.

    cPanel & WHM Script Hooks
     
Loading...

Share This Page