<div dir="ltr">Hi,<br><br>I have some subdirectories within a home directory that are chflagged schg, aka system immutable.<br><br>When I rsync the home directory to another machine, I get lots of errors for these subdirectories and they fail to copy to the target. NOTE: The target is empty; rsync is copying to an empty remote machine, not trying to overwrite anything.<br><br><div>I understand why this is happening; it's the schg flag. But is there a workaround using some combination of rsync options or multiple passes?<br></div><div><br><br><br>Here is an example.<br><br>The source directory is /Users/redacted.<br><br>Within /Users/redacted is a subdirectory foo that has flag schg set: /Users/redacted/Documents/artwork/foo<br><br><font face="monospace"># ls -laO /Users/redacted/Documents/artwork<br>total 80<br>drwxr-xr-x   20 redacted  staff  -        680 Sep 21 21:06 .<br>drwx------@ 609 redacted  staff  -      20706 Oct 29 16:07 ..<br>-rw-r--r--@   1 redacted  staff  -      18436 Sep 21 20:55 somefile<br>drwxrwxrwx@  18 redacted  staff  schg     612 Apr 12  2006 foo<br><br></font><br>My rsync args are:<br><br>--verbose --archive --one-file-system --acls --hard-links --xattrs<br>--protect-args --delete-after --numeric-ids --itemize-changes --crtimes<br>--fileflags --force-change<br>--rsync-path=/opt/rsync323/bin/rsync<br><br>My rsync version is 3.2.3<br><br>My execution and output looks like this, run as root:<br><br><br># /opt/rsync323/bin/rsync [ARGS ABOVE] /Users/redacted remotemachine.domain.com:/Users<br>.<br>.<br>rsync: [receiver] mkstemp "/Users/redacted/Documents/artwork/foo/bar/.background.tiff.vYOAS2" failed: Operation not permitted (1)<br>rsync: [receiver] mkstemp "/Users/redacted/Documents/artwork/foo/bar/.dc4.orange.CMYK.tiff.rYCmAP" failed: Operation not permitted (1)<br>rsync: [receiver] mkstemp "/Users/redacted/Documents/artwork/foo/bar/.barcode.tiff.2E4mec" failed: Operation not permitted (1)<br>.<br>.<br><br><br><br><br><br>In a nutshell:<br><br>Subdirectory foo gets created on the receiver, but it gets created with the schg flag set.<br><br>No further copying into foo can happen after that, because the schg flag prevents that.<br><br>Subdirectory bar cannot be created under foo, and .background.tiff.vYOAS2 and other files cannot be created under bar, etc.<br><br>How can I force the schg flags to be set on the receiver AFTER everything has been copied from the source?<br><br>I really don't want to remove all of my schg settings on the source before rsyncing to the target.<br><br>Would --no-perms allow this? But what would it break?<br><br><br><br>Thanks,<br>Fred<br></div></div>