rsync 传输文件名与源文件名不同

rysnc transfered file name differs from source file name

这个问题不是rsync特有的。如果我 touch 一个名为 /media/KINGSTON/seventeen. 的文件,那么创建的文件是 /media/KINGSTON/seventeen。有人可以解释为什么吗?

dmesg
. . .
ugen3.2: <Kingston DataTraveler 3.0> at usbus3
umass0 on uhub6
umass0: <Kingston DataTraveler 3.0, class 0/0, rev 2.10/1.10, addr 2> on usbus3
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:5:0: Attached to scbus5
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: <Kingston DataTraveler 3.0 PMAP> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 485B39472CCAB171D76F0DF0
da0: 40.000MB/s transfers
da0: 118272MB (242221056 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>


gpart show /dev/da0*
=>       63  242220993  da0  MBR  (116G)
         63      31041       - free -  (15M)
      31104  242189952    1  !12  [active]  (115G)

我正在使用 rsync 备份 cyrus-imap 邮件库。 Cyrus imap 消息文件名是数字后跟一个点 (####.)。当在 FreeBSD-11.2 主机上使用 rsync 传输这些消息文件时,目标文件名上的尾随点将被删除(####. 变为 ####)。有什么方法可以防止这种行为吗?

rsync \
  --copy-links  \
  --no-group  \
  --no-perms   \
  --progress  \
  --protect-args  \
  --modify-window=1  \
  --recursive  \
  --times  \
  --update  \
  --verbose  \
     ./Documents/Personal/IMAP  \
     /media/KINGSTON/Documents/Personal/IMAP

进一步测试表明,此行为取决于目的地。当从系统硬盘复制到系统硬盘时,尾随点出现在目标文件名中。当目标是 USB 密钥时,点将从目标中消失。

有效的 MS Windows 文件名中不允许有尾随点或 space。传输的文件在复制到 FAT 格式的 USB 时会悄悄更改名称以满足此要求。

来自 Microsoft 文件命名约定 (https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file):

Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not. However, it is acceptable to specify a period as the first character of a name. For example, ".temp".