I'm adding files to an existing tree via rsync -aO. Some of the directories on the remote are owned by a different user. I have rwx permissions on them but when rsync tries to set the permissions for those directories, it fails and exits with a non-zero status. This is expected but it complicates error detection on my end. Is there a way to make rsync not consider it an error when chmod() fails on a directory owned by someone else ? Possibly warn about it, but still exit with a zero status. stat (destpathname, &deststat); if ((deststat.st_mode & mask) != (srcstat.st_mode & mask)) { if (chmod (pathname, srcstat.st_mode) != 0) { if (errno == EPERM && deststat.st_uid != geteuid () && option_ignore_non_owner) { /* Expected error - just warn about it */ ; } else { /* Unexpected error - fail */ exit_with_non_zero_status = 1; } } } -- Andr? Majorel <URL:http://www.teaser.fr/~amajorel/> Do not use this account for regular correspondence. See the URL above for contact information.
On Mon, Oct 09, 2006 at 05:39:55PM +0200, Andre Majorel wrote:> there a way to make rsync not consider it an error when chmod() > fails on a directory owned by someone else ? Possibly warn about > it, but still exit with a zero status.There is a diff in the patches dir named omit-dir-changes.diff that adds the option --omit-dir-changes. When used, this option will stop rsync from trying to update the permissions on the directories at all. That's not quite what you were asking for, but it would silence the errors. ..wayne..