I want to backup some shared folders from my synology NAS to an external hard drive on my mac. Synology offers Hyper Backup using rsync for this kind of task. Since I can't get a task setup in Hyper Backup without it complaining about different errors, I figured I would just start by nailing the plain rsync side and then worry about Hyper Backup.
So far, the sync is successful as long as my rsync module's path points to a directory located on my main drive (i.e. /Users/bpjobin/directory). If I change it to one located in /Volumes, the sync won't work and throw me a error.
rsync.conf (on my Mac)
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log
[nas_backup_test]
use chroot = false
path = /Volumes/Untitled <-- This does not work.
#path = /Users/bpjobin/rsync_test <-- This works.
uid = root <-- Either root or bpjobin changes nothing.
gid = wheel <-- Either wheel or staff changes nothing.
list = yes
read only = no
write only = no
secrets file = /etc/rsync/rsyncd.secrets
auth users = bpjobin <-- User has root permissions.
hosts allow = *
Command ran from NAS
rsync -avz files bpjobin@<ipaddress>::nas_backup_test
The error...
building file list ... done
files/
rsync: failed to set times on "files" (in nas_backup_test): Operation not permitted (1)
files/book_1.txt
files/book_2.txt
files/book_3.txt
rsync: mkstemp "files/.book_1.txt.fBoMAq" (in nas_backup_test) failed: Operation not permitted (1)
rsync: mkstemp "files/.book_2.txt.4igwAi" (in nas_backup_test) failed: Operation not permitted (1)
rsync: mkstemp "files/.book_3.txt.mU7q7t" (in nas_backup_test) failed: Operation not permitted (1)
rsync: failed to set times on "files" (in nas_backup_test): Operation not permitted (1)
sent 243 bytes received 497 bytes 296.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1464) [sender=3.1.2]
Permissions on both directories
ā ~ ls -la /Volumes/Untitled
total 0
drwxrwxrwx 5 bpjobin staff 160 9 May 09:22 .
drwxr-xr-x 20 root wheel 640 9 May 08:24 ..
drwxrwxrwx 4 bpjobin staff 128 9 May 08:24 .Spotlight-V100
drwxrwxrwx 3 bpjobin staff 96 9 May 08:24 .fseventsd
drwxr-xr-x 2 bpjobin staff 64 9 May 09:22 files
ā ~ ls -la /Users/bpjobin/rsync_test
total 0
drwxr-xr-x 3 bpjobin staff 96 9 May 09:27 .
drwxr-xr-x@ 106 bpjobin staff 3392 9 May 09:27 ..
drwx------ 5 bpjobin _lpoperator 160 9 May 09:21 files
UPDATE
I should add that the following command work.
rsync -avz files bpjobin@<ipaddress>:/Volumes/Untitled
So the problem lies in the rsync.conf module parameters...
This took forever for me to figure out. The related things people mention about cron are unrelated. You need to go to Settings->General->Sharing->Remote Login click on the "i", and enable "Allow full disk access for remote users"