I'm writing a backup with rsync and a file with the systemd mount unit escape \x2d for - on a cifs (protocol version 3) (/mnt/diskstation/backup in this example) causes the following trouble:

> sudo rsync -a /etc/systemd/system/ /mnt/diskstation/backup/test/
rsync: recv_generator: failed to stat "/mnt/diskstation/backup/test/snap-openmapper\x2ddesktop-22.mount": Invalid argument (22)
rsync: symlink "/mnt/diskstation/backup/test/multi-user.target.wants/snap-openmapper\x2ddesktop-22.mount" -> "/etc/systemd/system/snap-openmapper\x2ddesktop-22.mount" failed: Invalid argument (22)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

Copying the file to /tmp with sudo rsync -a /etc/systemd/system/ /tmp/test/ works fine.

Some more info about the file:

> stat /etc/systemd/system/snap-openmapper\\x2ddesktop-22.mount 
  Datei: /etc/systemd/system/snap-openmapper\x2ddesktop-22.mount
  Größe: 263        Blöcke: 8          EA Block: 4096   Normale Datei
Gerät: 802h/2050d   Inode: 2243        Verknüpfungen: 1
Zugriff: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Zugriff    : 2019-01-13 10:35:13.500148076 +0100
Modifiziert: 2018-06-30 21:10:57.316164101 +0200
Geändert   : 2018-08-02 13:54:58.150254417 +0200
 Geburt    : -

I'm wondering where the responsibility for this behaviour lies: user (cifs might have trouble allowing \ in the name, but it's 2018, so...), rsync or cifs.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.