On 1/4/21 00:08, Joseph Bishay wrote:
Hello Adam and everyone,
Thank you for the reply. I've responded below:
On Tue, Mar 30, 2021 at 10:42 PM Adam Goryachev via BackupPC-users
<backuppc-users@lists.sourceforge.net
<mailto:backuppc-users@lists.sourceforge.net>> wrote:
On 31/3/21 12:26, Joseph Bishay wrote:
<snip>
I have BackupPC backing up a Linux client and it appears to only
back up certain files. The pattern seems to be that if the
directory has permissions of -rw-r--r-- BackupPC can enter, read
the files and back them up correctly, but if the directory has
permissions of drwx------ it creates that directory but cannot
enter and read the files within it.
The error log file shows multiple lines of:
Remote[1]: rsync: opendir "/directory/with/files" failed:
Permission denied (13)
Other parts of the filesystem are being backed up correctly it
appears. The BackupPC automatically connects as the user
BackupPC on the client and that backupPC user has the ability to
run rsync as root. On the client I have:
$ cat /etc/sudoers.d/backuppc giving:
backuppc ALL=NOPASSWD: /usr/bin/rsync
backuppc ALL=NOPASSWD: /usr/bin/whoami #added this one for debugging
From BackupPC running the command:
ssh -l backuppc client_IP "whoami"
returns backuppc
and running the command
ssh -l backuppc client_IP "sudo whoami"
returns root
so it seems to be working correctly.
In the client config file on BackupPC, variable is set as:
RsyncClientCmd = "$sshPath -q -x -l backuppc $host $rsyncPath
$argList+"
Aren't you missing a sudo somewhere in the command? not sure how
you have defined rsyncPath, but that looks like it could be the issue.
Maybe you could post the logs which will show the actual commands
being run after variable expansion.
Regards,
Adam
I am not sure if there should be a sudo somewhere or how that works
unfortunately - I do not understand this very well. rsyncClientPath
is defined as: /usr/bin/rsync It appears rsync is working since I am
getting part of the drive backed up, just not certain folders.
The Xferlog file shows:
Contents of file /var/lib/backuppc/pc/client_IP/XferLOG.0.z, modified
2021-03-28 21:25:06
full backup started for directory /
Running: /usr/bin/ssh -q -x -l backuppc client_IP /usr/bin/rsync
--server --sender --numeric-ids --perms --owner --group -D --links
--hard-links --times --block-size=2048 --recursive --ignore-times . /
You are definitely missing an "sudo" in there. If you see what you have,
you are calling ssh, with some flags "-q -x", using the account backuppc
(-l backuppc), to login to the remove machine "client_IP" and once
logged in running /usr/bin/rsync with some options .... etc.
ssh -l backuppc client_IP "whoami"
This is the same example you posted above, as you can see, it is running
as the user backuppc
ssh -l backuppc client_IP "sudo whoami"
As you can see, adding the "sudo" means you are going to end up running
the command as root.
RsyncClientCmd = "$sshPath -q -x -l backuppc $host $rsyncPath $argList+"
I would suggest changing this to:
RsyncClientCmd = "$sshPath -q -x -l backuppc $host /usr/bin/sudo
$rsyncPath $argList+"
Assuming your sudo is in /usr/bin/sudo. To check, login and run:
which sudo
Pretty sure that should solve the permissions problem, although I don't
use sudo with backuppc, so there could be other issues that I'm not
aware of.
Regards,
Adam
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/