I have a bash script which uses rsync to backup files in Archlinux. I noticed that rsync failed to copy a file from /sys, while cp worked just fine:# rsync /sys/class/net/enp3s1/address /tmp    rsync: read errors mapping /sys/class/net/enp3s1/address: No data available (61)rsync: read errors mapping /sys/class/net/enp3s1/address: No data available (61)ERROR: address failed verification -- update discarded.rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]# cp  /sys/class/net/enp3s1/address /tmp   ## this worksI wonder why does rsync fail, and is it possible to copy the file with it?
Why does rsync fail to copy files from /sys in Linux?
linux;arch linux;rsync;sysfs
Rsync has code which specifically checks if a file is truncated during read and gives this error  ENODATA. I don't know why the files in /sys have this behavior, but since they're not real files, I guess it's not too surprising. There doesn't seem to be a way to tell rsync to skip this particular check.I think you're probably better off not rsyncing /sys and using specific scripts to cherry-pick out the particular information you want (like the network card address).