Remote encrypted backup using gpg and rsync

Bare bones script to encrypt and copy all .pdf, .xls and .csv files in current directory to a remote server using rsync (I recommend rsync.net)

#! /bin/bash
R_USER="<your_user>"
R_HOST="<your_host>"
BASENAME=`basename "$PWD"`

echo "Your destination:"

read GPG_DEST

find . -iname '*[pdf|xls|csv]' -exec echo '{}' \; | while read f
do

    if [ -f "$f" ] && [ ! -f "$f".gpg ]; then

        gpg -e -r $GPG_DEST "$f"

        touch -r "$f" "$f".gpg

    fi

done

rsync -r --exclude=*.pdf --exclude=*.xls --exclude=*.csv --include=*.pdf.gpg . "$R_USER@$R_HOST:Documents/$BASENAME"