views:

4779

answers:

3

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.

+1  A: 

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?

David Wolever
I'm on a mac, rsync'ing to linux (a slicehost machine).
dreeves
Ah, strange...Since you're using rsync on the mac, though, I should warn you: it doesn't properly preserve all OS X file attributes, so Bad Things could happen. See, eg: http://blog.plasticsfuture.org/2006/04/23/mac-backup-software-harmful/
David Wolever
You can, however, use the most recent version from MacPorts (`sudo port install rsync`) and it will break less. To check it: `rsync --version`:rsync version 3.0.5 protocol version 30... append, ACLs, xattrs, iconv, symtimes, file-flags...(ACLs and xattrs are the important ones)
David Wolever
The Apple-provided rsync (at least on 10.5 and 10.6) has an `--extended-attributes` option that copies file attributes across.
mjs
+4  A: 

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.

Jon Bright
This answered helped me to sync between my mac and network storage. Thank you.
cocoafan
+1  A: 

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.

captain