Home Explore Blog CI



man-pages

30th chunk of `rsync.man`
18df2e51be5bf81a0c2a0ae6972c1ae515cab69ce8a144d00000000100000fe7
  tion (e.g. -XX).  This "copy all xattrs" mode cannot be used with
              --fake‐super.

       --chmod=CHMOD
              This option tells rsync to  apply  one  or  more  comma‐separated
              "chmod"  modes  to  the  permission of the files in the transfer.
              The resulting value is treated as though it were the  permissions
              that  the  sending  side  supplied for the file, which means that
              this option can seem to have  no  effect  on  existing  files  if
              --perms is not enabled.

              In addition to the normal parsing rules specified in the chmod(1)
              manpage,  you can specify an item that should only apply to a di‐
              rectory by prefixing it with a  ’D’,  or  specify  an  item  that
              should  only apply to a file by prefixing it with a ’F’.  For ex‐
              ample, the following will ensure that all directories get  marked
              set‐gid,  that  no  files are other‐writable, that both are user‐
              writable and group‐writable, and that both have  consistent  exe‐
              cutability across all bits:

                  ‐‐chmod=Dg+s,ug+w,Fo‐w,+X

              Using octal mode numbers is also allowed:

                  ‐‐chmod=D2775,F664

              It is also legal to specify multiple --chmod options, as each ad‐
              ditional option is just appended to the list of changes to make.

              See the --perms and --executability options for how the resulting
              permission value can be applied to the files in the transfer.

       --owner, -o
              This option causes rsync to set the owner of the destination file
              to  be  the  same  as  the source file, but only if the receiving
              rsync is being run as the super‐user (see also  the  --super  and
              --fake‐super  options).   Without  this  option, the owner of new
              and/or transferred files are set to the invoking user on the  re‐
              ceiving side.

              The  preservation  of  ownership will associate matching names by
              default, but may fall back to using the ID number in some circum‐
              stances (see also the --numeric‐ids option  for  a  full  discus‐
              sion).

       --group, -g
              This option causes rsync to set the group of the destination file
              to  be  the same as the source file.  If the receiving program is
              not running as the super‐user (or if --no‐super  was  specified),
              only  groups  that  the  invoking user on the receiving side is a
              member of will be preserved.  Without this option, the  group  is
              set  to  the  default group of the invoking user on the receiving
              side.

              The preservation of group  information  will  associate  matching
              names  by  default,  but  may fall back to using the ID number in
              some circumstances (see also the --numeric‐ids option for a  full
              discussion).

       --devices
              This  option  causes rsync to transfer character and block device
              files to the remote system to recreate these devices.  If the re‐
              ceiving rsync is not being run as the super‐user, rsync  silently
              skips creating the device files (see also the --super and --fake‐
              super options).

              By default, rsync generates a "non‐regular file" warning for each
              device file encountered when this option is not set.  You can si‐
              lence the warning by specifying --info=nonreg0.

       --specials
              This option causes rsync to transfer special files, such as named
              sockets  and  fifos.   If the receiving rsync is not being run as
              the super‐user, rsync silently skips creating the  special  files
              (see also the --super and

Title: Rsync Options: Chmod, Owner, Group, Devices, and Specials
Summary
This section details rsync options including '--chmod' for applying chmod modes to transferred files, with 'D' and 'F' prefixes to target directories or files specifically. '--owner' sets the destination file owner to match the source, requiring super-user privileges. '--group' similarly sets the group, with restrictions for non-super-users. '--devices' transfers character and block device files, skipped without super-user privileges. '--specials' transfers special files like named sockets and fifos, also requiring super-user privileges.