Bem, como um acadêmico excersize:
set -e # abort on errors
find /source -print | while read object_name; do
if [ -d "$object_name" ]; then
mkdir -p /destination/$object_name
else
if echo "$object_name" | egrep "(txt|html|...)" >/dev/null # extensions you want to compress
cat $object_name | gzip >/destination/${object_name}.gz
else
cp $object_name /destination/$object_name
fi
fi
rm /source/$object_name # could comment this out to preserve the source if you have the space
done