rsync error: failed to set times on “/foo/bar”: Op

2019-03-07 14:50发布

I'm getting a confusing error from rsync and the initial things I'm finding from web searches (as well as all the usual chmod'ing) are not solving it:

rsync: failed to set times on "/foo/bar": Operation not permitted (1)
rsync error: some files could not be transferred (code 23) 
  at /SourceCache/rsync/rsync-35.2/rsync/main.c(992) [sender=2.6.9]

It seems to be working despite that error, but it would be nice to get rid of that.

8条回答
手持菜刀,她持情操
2楼-- · 2019-03-07 15:24

This error might also pop-up if you run the rsync process for files that are not recently modified in the source or destination...because it cant set the time for the recently modified files.

查看更多
霸刀☆藐视天下
3楼-- · 2019-03-07 15:32

I had the same problem. For me the solution is to delete the remote file and let rsync create again.

查看更多
Deceive 欺骗
4楼-- · 2019-03-07 15:33

If /foo/bar is on NFS (or possibly some FUSE filesystem), that might be the problem.

Either way, adding -O / --omit-dir-times to your command line will avoid it trying to set modification times on directories.

查看更多
Bombasti
5楼-- · 2019-03-07 15:37

I've seen that problem when I'm writing to a filesystem which doesn't (properly) handle times -- I think SMB shares or FAT or something.

What is your target filesystem?

查看更多
祖国的老花朵
6楼-- · 2019-03-07 15:37

This happened to me on a partition of type xfs (rw,relatime,seclabel,attr2,inode64,noquota), where the directories where owned by another user in a group we were both members of. The group membership was already established before login, and the whole directory structure was group-writeable. I had manually run sudo chown -R otheruser.group directory and sudo chmod -R g+rw directory to confirm this.

I still have no idea why it didn't work originally, but taking ownership with sudo chown -R myuser.group directory fixed it. Perhaps SELinux-related?

查看更多
兄弟一词,经得起流年.
7楼-- · 2019-03-07 15:39

It could be that you don't have privileges to some of the files. From an administrator account, try "sudo rsync -av " Alternately, enable the root account and sign in as root. That should allow you to completely hose your system and brute force your rsync! ;-) I'm not sure if the above mentioned --extended-attributes will help, but I threw it in too, just for good measure.

查看更多
登录 后发表回答