I'm setting up a backup of my linux-based webserver to a NAS running FreeBSD. I've created a backup user on the FreeBSD box and ran rsync as root on the local (web server) box using the following command:
rsync -avz /hsphere/ email@example.com:/mnt/tank/web_backup/web01.webhost.net
It works fine for all directories owned by root, but when it starts backing up the directories owned by ordinary users, I get permission denied errors.
rsync: recv_generator: mkdir "/mnt/tank/web_backup/web01.webhost.net/hsphere/local/home/username/username.com" failed: Permission denied (13)
I was guessing this is because the "-a" tries to preserve the ownership of the original files, and since those users don't exist on the remote server, it was refusing it. I tried running rsync without the -o -g and -p flags thinking that would get around it, but I get the same error.
rsync -rltDz /hsphere/ firstname.lastname@example.org:/mnt/tank/web_backup/web01.webhost.net
If I rsync using root for the remote NAS, it does succeed, but I would rather not have to use root on the NAS if I can avoid it since it creates a security hole. The "backup_user" on the freebsd box is in the wheel group, which should give him sufficient permissions.
Any advice on how to proceed?