reflinks can be used as CoW mechanism for XFS since 4.17.0-2.el8
This feature enables two or more files to share a common set of data blocks. When either of the files sharing common blocks changes, XFS breaks the link to common blocks and creates a new file.
so with cp --reflink
we can create CoW blocks already. This is similar to btrfs CoW.
We can simply do following to mimic the snapshot:
find /root -mindepth 1 -maxdepth 1 -not -name "backup" -exec cp -r --reflink {} /root/backup/$(date)/ ;