My testing of valid/invalid rsync commands^ was hampered by apparent
delay in CIFS showing changes to the Windows Explorer on my PC. I did a test of rsync as below (approx 1200 files and 138MB) and Windows explorer showed the expected result. I deleted files/folders from destination and repeated same command. After several minutes Windows Explorer still shows destination folder empty. ls command from FreeNAS shell shows the data is actually there. No other significant activity is happening on the server. If it matters I turned off the recycle bin for this testing:
Code:
Shell
[root@freenas ~]# rsync -r /mnt/test/test1/ /mnt/test/test2
[root@freenas ~]# rsync -r /mnt/test/test1/ /mnt/test/test2
[root@freenas ~]# ls /mnt/test/test2
- Secure files dlink wpa - current.txt
.windows test.txt
[root@freenas ~]#
About five minutes later CIFS finally sends the correct information to Windows. This had led me to erroneously conclude that many of the rsync commands I was testing weren't copying any data at all. With this in mind I repeated my experiments from the command line shell in the GUI:
^
rsync flag testing in Windows ACL environment:
rsync -r copies folders successfully
rsync -a gives mkstemp error and only copies directory structure:
Code:
rsync: mkstemp "/mnt/test/test2/- Secure files/folder with space/subfolder/.file
.txt.NXK5Hm" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 2
3) at main.c(1053) [sender=3.0.9]
[root@freenas ~]#
The same with: [root@freenas ~]# rsync -rlptgoD /mnt/test/test1/ /mnt/test/test2
Code:
[root@freenas ~]# rsync -rlptgoD /mnt/test/test1/ /mnt/test/test2
<stuff happening>
rsync: mkstemp "/mnt/test/test2/- Secure files/folder with space/subfolder/.file
.txt.berqrA" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 2
3) at main.c(1053) [sender=3.0.9]
[root@freenas ~]#
Files transfer with rsync -rltD (no preserve permissions, group or owner) succeeds:
Code:
[root@freenas ~]# rsync -rltD /mnt/test/test1/ /mnt/test/test2
[root@freenas ~]# ls /mnt/test/test2
- Secure files dlink wpa - current.txt
.windows test.txt
Adding the -p command back triggers the error message and stops file, but not folder, transfer:
Code:
[root@freenas ~]# rsync -rlptD /mnt/test/test1/ /mnt/test/test2
Successful copy of files with:
[root@freenas ~]# rsync -rltgD /mnt/test/test1/ /mnt/test/test2
and:
[root@freenas ~]# rsync -rltgoD /mnt/test/test1/ /mnt/test/test2
There seems to be a problem with using the -p flags with rsync which are part of the -a "archive" flag. Can anybody tell me what is the practical of not using the -p flag with rsync?
In case this information is helpful I will post my findings to Bug Tracker.