I have a NAS that exports some directories as SAMBA shares. It works normally very well.
Now I have mounted this particular share on a Linux box, using
fstab
. This also works. However, I would like to use rsync
to download files from a server and synchronize two directories. However, I get from rsync
the error message
rsync: [receiver] failed to set times on "": Operation not permitted (1)
so for some weird reason, he cannot set the file time. I know I can "fix" this error with the --no-times
but then, the file times are not copied accordingly and, therefore, are wrong. Also it will then, I guess, cause problems with the next sync. For this reason I would like to have the times correctly set.
Funny enough, if I run the same rsync command as root
, setting the file times works! but it does not when it is run under another user.
rsync -avz --no-perms --no-owner --no-group --no-perms --no-times --password-file ~/passwordfile.txt
so it is not technically a problem of the SAMBA server, but it seems more like it is a restriction of the permissions. However, my SAMBA share is mounted with the following options
cifs vers=3,rw,uid=root,gid=transfer,file_mode=0666,dir_mode=0777,credentials=/etc/my_credentials.txt
so even though the owner of each file and directory is root
, everybody has R/W access and therefore, in my understanding, setting the file times should work. So I don't understand why it does not work when not run as root
. What is the proper fix of this?
Asked by T. Pluess
(626 rep)
May 14, 2025, 05:47 AM
Last activity: May 16, 2025, 09:29 AM
Last activity: May 16, 2025, 09:29 AM