#! /bin/sh
set -x
if [ -d /tmp/rsync_bug ]; then
    umount /tmp/rsync_bug/mnt
    rm -rf /tmp/rsync_bug
fi
mkdir /tmp/rsync_bug
cd /tmp/rsync_bug
mkdir mnt
mount -t tmpfs tmpfs mnt || exit 1
ln -s BLABLA mnt/test
mkdir src
ln -s /tmp/rsync_bug/mnt src/dir
rsync -aHx --delete --numeric-ids  src/  dst1
rm src/dir
mkdir src/dir
cp -a mnt/test src/dir/
rsync -aHx --delete --numeric-ids --link-dest /tmp/rsync_bug/dst1  src/  dst2 || echo RSYNC FAIL


