I run into a "Disk quota exceeded (122)" error if I use
rsync -p <args> to copy files around.
rsync -rlptD --chown username:org1 -- local/ /project/org1/
I would like to preserve source read and execute bits on files and directories, but force the destination to have group setuid
g+s on directories.
The reason for wanting
g+s on directories is so that new files inherit the project's group ownership. In my environment, if files within project folders (e.g.
/project/foo/) are owned by my personal group (groupname == username), I run into the quota error.
I've given the
--chown username:org1 argument to rsync as an attempt to force usage of group
org1 throughout, but it's insufficient. I think there's a race condition where rsync applies the desired
user:group ownership after the temporarily files are renamed to their final location.
If I remove the
-p from the rsync flags, then I can transfer without errors, but I lose the permission bits from the source. Without
-p, any temporary file created by rsync in the destination folder correctly inherits the project group from the root folder, and subfolders inherit the group setuid.
Is there a way to give rsync a mask of permissions to keep? I need bitmask 777 from the source, but
g+s set (unconditionally) for remote directories.