#!/bin/bash -eu
cd $(mktemp -d)

mkdir -p src copy_dest/good copy_dest/bad

echo good > src/file
echo good > copy_dest/good/file
echo bad  > copy_dest/bad/file

tree

touch -d "2000/01/01 00:01:00" src/file copy_dest/bad/file
rsync -avc --link-dest=../copy_dest/good --link-dest=../copy_dest/bad src/ dest

echo 'this should be good:'
cat dest/file
