#!/bin/bash

REMOTE='moria:~/tmp/rsync-bugtest/sample-data'
DEST='.'

# Clean up
rm -rf $DEST/sample-data

echo 
echo "Successful case"
echo "-------------------"
rsync -aP $REMOTE $DEST

# Clean up
rm -rf $DEST/sample-data

echo 
echo "Now the error"
echo "-------------------"
rsync -aXP $REMOTE $DEST


#rsync $OPTIONS $REMOTE $DEST > >(tee rsync-out.txt) 2> >(tee rsync-errors.txt >&2)

# See stdout+stderr output and split to log files
# command > >(tee stdout.log) 2> >(tee stderr.log >&2)

