By default rsync
verifies written files to make sure that it matches the original file. I can reproduce this by copying a volatile file from /sys
$ rsync -v /sys/power/state /tmp/
state
rsync: read errors mapping "/sys/power/state": No data available (61)
WARNING: state failed verification -- update discarded (will try again).
state
rsync: read errors mapping "/sys/power/state": No data available (61)
ERROR: state failed verification -- update discarded.
sent 8,328 bytes received 133 bytes 16,922.00 bytes/sec
total size is 4,096 speedup is 0.48
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.0]
Is there an option to turn this error into a warning and without discarded the file again?
Context: I want to use rsync instead of cp
to workaround a common bug in coreutils (broken since 12 years), see Why does cp --no-preserve=mode preserves the mode? Alternative tools available?
/sys
"files" as they are not regular files. For example, they will have a size of 4096 bytes, but only contain 16 bytes. – meuh Oct 11 '16 at 14:57