Changing WHM Backup Ownership

tmorton2

Member
Oct 11, 2012
9
0
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!
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
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