I'm trying to sync data to a NFS share while preserving timestamps.
Original file:
-rw-rw-r-- 1 simon simon 1554756 Apr 18 2017 IMG_0578-Bearbeitet.jpg
Used rsync options are -avh --progress
.
While copying I got warnings like
rsync: chgrp "/media/simon/.../.IMG_0578-Bearbeitet.jpg.dXOTKi" failed: Operation not permitted (1)
After the action the file metadata is as follows
-rw------- 1 www-data www-data 1554756 Dez 6 00:59 IMG_0578-Bearbeitet.jpg
I suspect, chgrp
fails because the NFS drive is mounted so that user and group is always set to www-data (options of the nfs share are (rw,sync,all_squash,anonuid=33,anongid=33,no_subtree_check)
).
I find it now weird that
- There is no error message about the owner that can't be changed too
- As a side effect the time was also not preserved
If I omit the -g
from the rsync options like -rlptoDvh --progress
(everything from -a
except -g
), then I get no errors and as a result
-rw-rw-r-- 1 www-data www-data 1554756 Apr 18 2017 IMG_0578-Bearbeitet.jpg
So exactly what I wanted.
What explains these two for me unexpected behaviours?
By the way, omitting just -o
does not give anything and results in the same behaviour as with full -a
.
rsync
as root?simon
without sudo, so the original owner of the files.